keyongtech


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

 #1  
08-19-08, 12:19 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, 04:26 PM
Frank Werner-Krippendorf
Hello John,

you could place your code in the container's 'MouseMove' event handler:


private void Form1_MouseMove(object sender, MouseEventArgs e)
{

if ((e.X >= yourButton.Left && e.X <= yourButton.Right) &&
(e.Y >= yourButton.Top && e.Y <= yourButton.Bottom))
{
MessageBox.Show("?");
}


}


Frank Werner-Krippendorf
[..]
 #3  
08-20-08, 05:15 AM
Duggi
On Aug 19, 8:26 pm, Frank Werner-Krippendorf <Frank.werner-
krippend...@franke.com> wrote:
> Hello John,
>
> you could place your code in the container's 'MouseMove' event handler:
>
>  private void Form1_MouseMove(object sender, MouseEventArgs e)
>         {
>
>             if ((e.X >= yourButton.Left && e.X <= yourButton.Right) &&
>                 (e.Y >= yourButton.Top && e.Y <= yourButton.Bottom))
>             {
>                 MessageBox.Show("?");
>             }
>
>         }
>
> Frank Werner-Krippendorf
>


I think thats excellent idea... Let me see if that works out...

-Cnu
 #4  
08-20-08, 05:52 PM
Duggi
On Aug 19, 8:26 pm, Frank Werner-Krippendorf <Frank.werner-
krippend...@franke.com> wrote:
> Hello John,
>
> you could place your code in the container's 'MouseMove' event handler:
>
>  private void Form1_MouseMove(object sender, MouseEventArgs e)
>         {
>
>             if ((e.X >= yourButton.Left && e.X <= yourButton.Right) &&
>                 (e.Y >= yourButton.Top && e.Y <= yourButton.Bottom))
>             {
>                 MessageBox.Show("?");
>             }
>
>         }
>
> Frank Werner-Krippendorf
>


This works out cooool....

-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 05:05 AM. | Privacy Policy