Con "Cursor.Position = New Point(x, y)" pero devo mettere valori numerici come 0 0 o no? Perchè io vorrei usare delle variabili
Ok ho risolto con il codice seguente al inizio del Form:
codice:
Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
Public Const LEFTDOWN As Short = &H2
Public Const LEFTUP As Short = &H4
Public Const MIDDLEDOWN As Short = &H20
Public Const MIDDLEUP As Short = &H40
Public Const RIGHTDOWN As Short = &H8
Public Const RIGHTUP As Short = &H10
E poi in un Sub Button_Click il seguente:
codice:
Cursor.Position = New Point(X1, Y1)
mouse_event(LEFTDOWN, 0, 0, 0, 0)
mouse_event(LEFTUP, 0, 0, 0, 0)
X1 e Y1 sono variabili.