473,387 Members | 1,535 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,387 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 2341
"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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.