Getting MouseUp-Event

  • Thread starter Thread starter Tim Bücker
  • Start date Start date
T

Tim Bücker

Hello.

I have a window form with some panels on it.
In one panel I am using the OnMouseDown and OnMouseUp events.
MouseDown initiates some things and MouseUp releases some things - so it is
important that I get both events!

Problem:
The user presses the mouse but than leaves the panel and releases the mouse
outside this panel.
So this way I don´t get the needed OnMouseUp event.

Is there a way to get a "global" OnMouseUp event?

What is the best solution for this scenario?
Thanks for any information!

Greetings,
Tim.
 
Generally when I interact with a button that way it means I didn't want to
click where I did, so I don't want anything to happen. ...but that's just GUI
friendliness and my opinion and doesn't really help much does it?
I'm certainly no expert here but I would have though that you could catch
the event that the mouse has left the panel (VS.NET has that cool pane in the
form designer that lets you see all the events you can catch on an object and
will take you through adding and attaching the handler if you double click
one). If you catch this event while you know the mouse button is down you can
behave appropriately.

Aaron.
 
Tim Bücker said:
Hello.

I have a window form with some panels on it.
In one panel I am using the OnMouseDown and OnMouseUp events.
MouseDown initiates some things and MouseUp releases some things - so it
is
important that I get both events!

Problem:
The user presses the mouse but than leaves the panel and releases the
mouse
outside this panel.
So this way I don´t get the needed OnMouseUp event.

Is there a way to get a "global" OnMouseUp event?

What is the best solution for this scenario?
Thanks for any information!

Greetings,
Tim.

I am not sure about a global mouse_up event but I am curious if you could
use the Mouse_Leave event to warn you that the user is leaving that panel?
 
Tim Bücker said:
I have a window form with some panels on it.
In one panel I am using the OnMouseDown and OnMouseUp events.
MouseDown initiates some things and MouseUp releases some things - so it is
important that I get both events!

Problem:
The user presses the mouse but than leaves the panel and releases the mouse
outside this panel.
So this way I don´t get the needed OnMouseUp event.

Is there a way to get a "global" OnMouseUp event?

Thanks for answering!
But unfortunately the Mouse_Leave event doesn´t help me!

Greetings,
Tim.
 
ok, how about restricting movement of the mouse? this is probably considered
a hack and bad practice for accessibility and security but it used to be
possible to stop the mouse leaving the boundaries of a certain control

just a suggestion :-)
 
Back
Top