473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Calling mousehover event for dynamic button control?

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

Mar 1 '07 #1
3 4266
On Mar 1, 11:07 am, "Marc" <marc_cro...@hotmail.comwrote:
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

Mar 1 '07 #2
On 1 Mar, 16:24, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 1, 11:07 am, "Marc" <marc_cro...@hotmail.comwrote:
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
great thanks

Mar 1 '07 #3
On 1 Mar, 16:24, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Mar 1, 11:07 am, "Marc" <marc_cro...@hotmail.comwrote:
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
great thanks

Mar 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rob | last post by:
I need a way to determine the name of the control that called an event. I have tested many different code variations but none seem to work. The one that makes the most sense to me is below, but it...
0
by: JJay | last post by:
My application is written in C# and has several dialog Windows Forms. All button objects on all forms are using FlatStyle=Flat. I have background colors on each button and tool-tips describing...
0
by: jaxCtiDev | last post by:
My application is written in C# and has several dialog Windows Forms. All button objects on all forms are using FlatStyle=Flat. I have background colors on each button and tool-tips describing...
1
by: Natan | last post by:
I was playing with control events and noticed that if try to change the color of a button or text in a MouseHover event, it is slow to respond. It takes about half a second to notice that the mouse...
1
by: Phenix Smith | last post by:
I am working on the component and would like to change a display when the user stops moving the mouse inside the control. I used the MouseHover and MouseMove to change the status, but the...
5
by: RA | last post by:
I have created a button dynamically; which has been added to a TableCell of a TableRow of a Table control. Is there a way to add onclick event which calls a procedure on the Server-side itself....
12
by: Marc | last post by:
Hi, How can i increase the mousehover event timer? AddHandler NewBtn.MouseHover, AddressOf Shownotes Private Sub Shownotes(ByVal sender As System.Object, ByVal e As System.EventArgs)...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.