Private Sub Command1_Click() Dim i As Integer For i = 1 To 5 Form_Click Next Form1.Caption = temp End Sub
Private Sub Form_Click() temp = temp + 1 End Sub
也可以使用API
Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)