click procedure for dynamically created button?

  • Thread starter Thread starter What-a-Tool
  • Start date Start date
W

What-a-Tool

"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
 
"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()

???
 
Sorry - being a dummy.
Soon as I wrote the click event, the error went away.
 
Hello,

What-a-Tool said:
"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?!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top