Results 1 to 2 of 2

Thread: Mouse Move Event

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 1999
    Posts
    34
    Hi, I've been experimenting using picture boxes in an array.

    The program serves no purpose other than to teach me about arrays.

    What happens is when the mouse moves over one of the picture
    boxes, the border style is changed to 1 and the other
    picture box borders all change to 0.

    It seems to work ok, but everytime the mouse moves one pixel
    on the button all of the code for that mouse move event will
    execute again. Is there anyway for my program to know that
    even though the mouse has moved it is still over the same
    button, so the code will not execute until the mouse has moved to another picture box.

    thanks in advance

    MICK

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Try to make it sorta "memorize" the last index of the picture it moved over.
    Something like this should work:
    Code:
    Private Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
        Static iLastIndex As Integer
        
        If iLastIndex = Index Then Exit Sub
        iLastIndex = Index
        
        ' Put all the rest of your MouseMove code here.
    End Sub

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