keyongtech


  keyongtech > dotnet.languages.* > dotnet.languages.csharp > 08/2008

 #1  
08-19-08, 12:18 PM
john ciriello
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.
 #2  
08-19-08, 02:05 PM
Duggi
On Aug 19, 4:18 pm, "john ciriello" <jcirie> wrote:
> 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
Similar Threads
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...

right mouse button disabled by websites

Hello Some websites seem to be able to modify the functions of the right mouse button. ? How do they do that & can I over-ride it ? Thanks K

Automatically invoking an Focussed button without pressing Enter or Mouse Button

hai, I have a small problem regarding the Focussed button. In my project i will call an exe so that an pop up will come with 2 Buttons. In those 2 buttons one will be...

Automatically Invoking an Focussed Button without pressing Enter key or Mouse Button

hai, I have a small problem regarding the Focussed button. In my project i will call an exe so that an pop up will come with 2 Buttons. In those 2 buttons one will be...

Enter button disabled!

Please help. I work with Windows XP Home edition and i have Internet Explorer 6 and every time i go on the net, it disables my "Enter" button. I have deactivated all...


All times are GMT. The time now is 10:30 AM. | Privacy Policy