By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,698 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,698 IT Pros & Developers. It's quick & easy.

click procedure for dynamically created button?

P: n/a
"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
Share this Question
Share on Google+
3 Replies


P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.