Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mouse move event catch problem

Status
Not open for further replies.

seymourc64

Programmer
Apr 27, 2005
2
YU
I have this problem in my application.I need to catch mouse move event on paintbox(which is on the form) when it is happening on form and mouse button is not pressed.
 
Ok,PaintBox is derived from TControl,but I dont understand how you think i can handle this event.Imagine i am in one state and i want to stay in that state even if i dont hold mouse button,and move pointer outside of paintbox.I want to prevent changing cursor and also want to disable selection of menus,buttons and other element of form.Do you mean i use some internal loop(explain me a little bit more your soluttion)
 
TControl::OnMouseMove will be activated every time the mouse is moved within the associated control, whether that is the TPaintBox or the TForm. I don't understand what else you are looking for.
 
You can catch next events :

1. CM_MOUSEENTER / CM_MOUSELEAVE when mouse pointer "enters/leaves" the control (client) area.
Unfortunately there is no message handler in the VCL controls so you must write your own.

2. WM_MOUSE_MOVE is mapped on the OnMouseMoveEvent;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top