Calling mousehover event for dynamic button control?

M

Marc

Hi,

I create buttons dynamically at runtime in my application. I want to
open a messgae box when the user hovers over a button.how can i do
this?

i need something like the below(which doesnt work!)

Private Sub test (ByVal sender As System.Object, ByVal e As
System.EventArgs)Handles me.activecontrol.mousehover
msbox("test")
end sub

Thanks
 
R

rowe_newsgroups

Hi,

I create buttons dynamically at runtime in my application. I want to
open a messgae box when the user hovers over a button.how can i do
this?

i need something like the below(which doesnt work!)

Private Sub test (ByVal sender As System.Object, ByVal e As
System.EventArgs)Handles me.activecontrol.mousehover
msbox("test")
end sub

Thanks

For dynamic created controls you need to map the event(s) dynamically
too.

i.e.

private sub AddButton()
Dim b as new button()
AddHandler b.MouseHover, AddressOf test
end sub

private sub test(sender as object, e as eventargs)
msgbox("test")
end sub

Thanks,

Seth Rowe
 
M

Marc

For dynamic created controls you need to map the event(s) dynamically
too.

i.e.

private sub AddButton()
Dim b as new button()
AddHandler b.MouseHover, AddressOf test
end sub

private sub test(sender as object, e as eventargs)
msgbox("test")
end sub

Thanks,

Seth Rowe

great thanks
 
M

Marc

For dynamic created controls you need to map the event(s) dynamically
too.

i.e.

private sub AddButton()
Dim b as new button()
AddHandler b.MouseHover, AddressOf test
end sub

private sub test(sender as object, e as eventargs)
msgbox("test")
end sub

Thanks,

Seth Rowe

great thanks
 

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