Specify mouseClick event for controls created at runtime


B

Bill Nguyen

I added a button control at runtime to a webbrowser control (also created at
runtime)
How do I specify the action when user clicks on this button since it's not
available in design time?

Thanks a million

Bill
-------------------

Dim mButton1 As New Button

With mWeb1

mButton1.Text = "Test"

..Dock = DockStyle.Fill

..Navigate(mUrl1)

..Controls.Add(mButton1)

End With
 
Ad

Advertisements

H

Herfried K. Wagner [MVP]

Bill Nguyen said:
I added a button control at runtime to a webbrowser control (also created
at runtime)
How do I specify the action when user clicks on this button since it's not
available in design time?
Check out the 'AddHandler' statement.
 

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

Top