473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

click procedure for dynamically created button?

"btnExit is not a member of frmMain" message in the AddHandler Line.

What do I need to do other than the AddHandler?

'Create Exit button

btnExit.Location = New Point(425, 565)

btnExit.Size = New Size(75, 30)

btnExit.Text = "Exit"

btnExit.Visible = True

AddHandler btnExit.Click, AddressOf Me.btnExit_Click

Thanks Again - Sean
Nov 20 '05 #1
3 2344
"What-a-Tool" <Fr***********************@cox.net> wrote in news:9GZab.129
$0Z5.18@lakeread03:
"btnExit is not a member of frmMain" message in the AddHandler Line.


Did you declare a new button? i.e.

Dim btnExit as button = New Button()

???

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #2
Sorry - being a dummy.
Soon as I wrote the click event, the error went away.
"What-a-Tool" <Fr***********************@cox.net> wrote in message
news:9GZab.129$0Z5.18@lakeread03...
"btnExit is not a member of frmMain" message in the AddHandler Line.

What do I need to do other than the AddHandler?

'Create Exit button

btnExit.Location = New Point(425, 565)

btnExit.Size = New Size(75, 30)

btnExit.Text = "Exit"

btnExit.Visible = True

AddHandler btnExit.Click, AddressOf Me.btnExit_Click

Thanks Again - Sean

Nov 20 '05 #3
Hello,

"What-a-Tool" <Fr***********************@cox.net> schrieb:
"btnExit is not a member of frmMain" message in the AddHandler
Line.

What do I need to do other than the AddHandler?


What's the problem?!

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Liqun Xu | last post by:
Hallo NG, I created a Button with Click-Event dynamically: System.Web.UI.WebControls.Button bt_1 = new Button(); bt_1.Click += new EventHandler(bt_1_click); and I implemented the Funktion...
6
by: Michael Johnson Jr. | last post by:
I am trying to handle a button click event, which updates a web control table with data. The button is dynamically created in the table itself. When I call updateTable() in the Page_Load the new...
1
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the...
3
by: What-a-Tool | last post by:
"btnExit is not a member of frmMain" message in the AddHandler Line. What do I need to do other than the AddHandler? 'Create Exit button btnExit.Location = New Point(425, 565) ...
2
by: Kjell Kristiansson | last post by:
I have not been able to figure out how to catch the click event from a button that is added dynamically to a table. In priciple the process is as follows: When I first create the page I analyse...
4
by: Bob | last post by:
Hi, I'm working with VWD and i defined programmatically a button (in code-behind) with an ID. So I expect to see beside "Page Events" and "Form1" my button "b1" in order to use the Click event....
5
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
4
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi, I have built a custom control button which inherits from WebControl and implements IPostBackEventHandler. The control also declares an event Click and provides a method OnClick which invokes...
0
by: aparnaa | last post by:
hi i am developing a web page in asp.net(VB) here i have dynamicaaly created a button. i have created this button in a procedure so that i can call it at varied places. however, i am not able to...
2
by: =?Utf-8?B?SGV6YWw=?= | last post by:
Hi, I am trying to add a new record to a table but everytime I click the button, somehow it saves the record twice... I've created a stored procedure to insert records into a table and I called...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.