Results 1 to 5 of 5

Thread: [RESOLVED] Mouse move event will only work on the very top and right side?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    Resolved [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.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    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

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    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. Name:  Code Trigger.jpg
Views: 166
Size:  20.2 KB

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    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

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    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
  •  



Click Here to Expand Forum to Full Width