Buona sera, il mio problema è il seguente
Ho creato uno script che al click con il pulsante destro del Mouse sopra ad una PictureBox, la muove in base allo spostamento del cursore.
Ecco lo Script:
'Movimento Icone
Public Cestino = 0
Public Giochi = 0
Public MyApp = 0
Public Market = 0
Public Sveglia = 0
'Disattivazione del movimento
Private Sub Form2_Click(sender As Object, e As System.EventArgs) Handles Me.Click
If Cestino = 1 Then
Timer9.Stop()
Cestino = 0
ElseIf Giochi = 1 Then
Timer9.Stop()
Giochi = 0
ElseIf MyApp = 1 Then
Timer9.Stop()
MyApp = 0
ElseIf Market = 1 Then
Timer9.Stop()
Market = 0
ElseIf Sveglia = 1 Then
Timer9.Stop()
Sveglia = 0
End If
End Sub
'PictureBox su cui viene fatto click con il pulsante destro
Private Sub PictureBox3_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles PictureBox3.MouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
If Cestino = 0 Then
Timer9.Start()
Cestino = 1
ElseIf Cestino = 1 Then
Timer9.Stop()
Cestino = 0
End If
End If
End Sub
'Il timer che provoca lo spostamento del PictureBox
Private Sub Timer9_Tick(sender As System.Object, e As System.EventArgs) Handles Timer9.Tick
If Cestino = 1 Then
PictureBox3.Location = New Point(Cursor.Position.X, Cursor.Position.Y)
ElseIf Giochi = 1 Then
PictureBox4.Location = New Point(Cursor.Position.X, Cursor.Position.Y)
ElseIf MyApp = 1 Then
PictureBox5.Location = New Point(Cursor.Position.X, Cursor.Position.Y)
ElseIf Market = 1 Then
PictureBox6.Location = New Point(Cursor.Position.X, Cursor.Position.Y)
ElseIf Sveglia = 1 Then
PictureBox7.Location = New Point(Cursor.Position.X, Cursor.Position.Y)
End If
End Sub
Il suo dovere lo fa, il problema è che la PictureBox non è esattamente sotto al cursore ma più spostata rispetto al cursore... Vorrei fare in modo che la PictureBox sia perfettamente sotto al cursore, come posso fare?