By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,703 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,703 IT Pros & Developers. It's quick & easy.

Detect mouse enter when button disabled

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.