![]() |
|
#1
|
|||
|
|||
|
Hi guys I am having a small issue that, despite my best efforts, I cannot work out. Maybe its cause I've been up for 38 hours now
![]() I need code to be run when the mouse enters the form, and then again when the mouse leaves the form. So - simple answer right? USE THE BLERRIE FORMMOUSEENTER AND FORMMOUSELEAVE EVENTS RIGHT?......WRONG. The problem is I dont want the code to be run when the mouse simply moves over one of the components on the form. So the issue I'm having is the code is run when I move the mouse over a button on the form, but I only want it to be run when I move the mouse off the application completely. Any help or possible solutions to the problem are greatly appreciated Thanks Regards |
|
#2
|
|||
|
|||
|
Use GetCursorPos to get the mouse position and check it it is in the area of the form. Other functions that might come in handy are ClientToScreen and ScreenToClient. You could also look into the GetCapture and SetCapture functions.
|
|
#3
|
|||
|
|||
|
Thank you for your response mdixon7610
I have fully researched all the functions you suggested, and while they would have provided a solution to the issue I described, they created other problems within my application. I have actually got a version working now using a timer funnily enough, it just needs to be fully tested before I think about releasing anything. I am a bit worried the timer will put strain on the pc performance, but time will tell. Regards |
![]() |
| Tags |
| "leave whole application", component, mouseenter, mouseleave |
| Thread Tools | |
| Display Modes | |
|
|