mousemove

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lilh0ney05
    New Member
    • Aug 2006
    • 7

    mousemove

    :confused:
    can somebody give me a simple syntax on how to use the mousemove event?
    pls.........pls ...........plss ..........
    i badly needed it for our project.......
    :(
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Hi there,

    Please be specific when asking question, an array of functions can be included in the MOUSEMOVE event, so, which one are you looking for?

    Comment

    • Ste The Fluffy
      New Member
      • Sep 2006
      • 10

      #3
      MouseMove occurs when your mouse moves over an object.

      Create a userform with a label on it (Named Label1, as is default)
      Add this code:

      Code:
      Private Sub Form_Load()
      Label1.Caption = "No mouse on me"
      Label1.BackColor = vbGreen
      End Sub
      
      Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
      Label1.Caption = "No mouse on me"
      Label1.BackColor = vbGreen
      End Sub
      
      Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
      Label1.Caption = "Ahhh! Get that mouse off me!"
      Label1.BackColor = vbRed
      End Sub
      Debug.
      Place your mouse over the label. Observe.
      Move it back on to the form background. Observe.

      You should notice the state of the label changes depending on whether or not the mouse is on it.

      I hope this helps.
      Ste <><

      Comment

      • lilh0ney05
        New Member
        • Aug 2006
        • 7

        #4
        Thank you so much for the reply, STE the fluffy!!!
        it helps a lot!!!

        Comment

        Working...