469,963 Members | 1,323 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

Detect mouse enter when button disabled

Hi, is there an easy way to detect when the mouse pointer enters a disabled
button? For example I have a button I can see but it is greyed out. When the
mouse moves over it I would like to be able to right click and have it
respond with a context menu. Any ideas? Thanks in advance.
Aug 19 '08 #1
1 5703
On Aug 19, 4:18*pm, "john ciriello" <j.cirie...@comcast.netwrote:
Hi, is there an easy way to detect when the mouse pointer enters a disabled
button? For example I have a button I can see but it is greyed out. When the
mouse moves over it I would like to be able to right click and have it
respond with a context menu. Any ideas? Thanks in advance.
I do not know why you wanted a disabled button to raise an event. A
disabled control can not raise any event by the design of the Winform
Programming it self.

How ever you can achieve the functionality that you are talking about
with a little tweak.

Place a group box aroung the button exactly of the same size so that
it does not appear to the user.

Now the ContextMenuStrip that was attached to the button can be
assinged as a Contextmenu for the groupbox.

As groupbox is enabled always, can sent what ever event you are
interested in, and still in the region of button, it appears like
button is sending the events. (I mean to say user experience would be
same).

Hope this trick is helpful.

-Cnu

Aug 19 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by bart plessers | last post: by
3 posts views Thread by blue_nirvana | last post: by
3 posts views Thread by john ciriello | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.