Specify mouseClick event for controls created at runtime

  • Thread starter Thread starter Bill Nguyen
  • Start date Start date
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
 
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.
 
Back
Top