Home All Groups Group Topic Archive Search About

Specify mouseClick event for controls created at runtime

Author
31 Oct 2006 12:04 AM
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

Author
31 Oct 2006 12:16 AM
Herfried K. Wagner [MVP]
"Bill Nguyen" <billn_nospam_please@jaco.com> schrieb:
>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.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>