Results 1 to 2 of 2

Thread: Make a button follow the mouse.

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    10

    Make a button follow the mouse.

    I am trying to make a button follow the mouse but with the code below the actual button is maybe about 2 inches off from the mouse's pointer. The
    button is about 2 inches to the right and below of the cursor but it does follow around as intended, but for some reason when the form is maximised it is only about 1 inch to the right and 1 inch below the cursor.
    VB Code:
    1. Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
    2.         Dim MouseX As Integer = Me.MousePosition.X
    3.         Dim MouseY As Integer = Me.MousePosition.Y
    4.         Me.btnRun.Location = New Point(MouseX, MouseY)
    5.     End Sub
    Last edited by nclax99; Jan 13th, 2006 at 12:21 PM.

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