-
May 18th, 2014, 07:05 PM
#1
Thread Starter
PowerPoster
[RESOLVED] Mouse move event will only work on the very top and right side?
Hi there folks. I have a math prog for students, where if they want to remove an item, they simply drag it off the form. The screen is set up with a workspace in the middle of the screen, then the rest of the form around it. Basically I am looking for when the student drags anything from the middle box to the outside of it, it then triggers the event. However right now, it only works for the top of the middle box, and the right side of the box, and not the bottom of the box, or left side of it.
This is my IF THEN statement for position, did I make a mistake formatting?
If (.Top > 0 And .Top < 1440) Or (.Top > 6360 And .Top < 8475) And (.Left > 0 And .Left < 3600) Or (.Left > 11700 And .Left < 14690) Then
The (.Top > 0 And .Top < 1440) and the (.Left > 0 And .Left < 3600) isn't triggering the event though?
Can anyone see where a made a mistake?
Thanks!!!
If it helps, picture a small square in a bigger square, and you'll sort of get the idea.
-
May 18th, 2014, 07:27 PM
#2
Re: Mouse move event will only work on the very top and right side?
Looks like you need to add some more () around your Or sections
I think what you want is more like
If ((.Top > 0 And .Top < 1440) Or (.Top > 6360 And .Top < 8475)) And ((.Left > 0 And .Left < 3600) Or (.Left > 11700 And .Left < 14690)) Then
-
May 18th, 2014, 07:39 PM
#3
Thread Starter
PowerPoster
Re: Mouse move event will only work on the very top and right side?
Thanks. That did change things up a bit, but what I am getting is detection in the 4 corners, but not between. I will send an attachment jpg of what I mean.
-
May 18th, 2014, 07:51 PM
#4
Re: Mouse move event will only work on the very top and right side?
That would be due to the and statements you are using
Try changing that And in the middle to OR
-
May 18th, 2014, 08:05 PM
#5
Thread Starter
PowerPoster
Re: Mouse move event will only work on the very top and right side?
Oh that is awesome! Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|