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:
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove Dim MouseX As Integer = Me.MousePosition.X Dim MouseY As Integer = Me.MousePosition.Y Me.btnRun.Location = New Point(MouseX, MouseY) End Sub




Reply With Quote