Calling mousehover event for dynamic button control?

  • Thread starter Thread starter Marc
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top