Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Apps

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2012, 01:09 AM
Typhoonbot Typhoonbot is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Question MouseEnter/Leave form issue

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
Reply With Quote
  #2  
Old 02-13-2012, 01:12 PM
mdixon7610 mdixon7610 is offline
Senior Member
 
Join Date: Sep 2003
Posts: 141
Default

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.
Reply With Quote
  #3  
Old 02-13-2012, 03:08 PM
Typhoonbot Typhoonbot is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Default

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
Reply With Quote
Reply

Tags
"leave whole application", component, mouseenter, mouseleave

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:27 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.