Muchas gracias pero me da un error al copilar y nose que hago mal ahi les dejo el code aver si me dicen que esta mal hecho
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSELEFTDOWN = &H2 ' left button down /This is actually MOUSEEVENTF_LEFTDOWN
Private Const MOUSELEFTUP = &H4 ' left button up /This is actually MOUSEEVENTF_LEFTUP
Private Const KEY_TOGGLED As Integer = &H1
Private Const KEY_PRESSED As Integer = &H1000
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF9 Then
Call Command1 Timer1.Enabled = True
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer2.Enabled = True
Me.KeyPreview = True
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Option3_Click()
Timer1.Interval = (1)
End Sub
Private Sub Timer1_Timer()
mouse_event MOUSELEFTDOWN, 0, 0, 0, 0 'left button goes down
mouse_event MOUSELEFTUP, 0, 0, 0, 0 'left button comes up
End Sub
Private Sub Timer2_Timer()
If GetKeyState(vbKeyF1) And KEY_PRESSED Then
Timer1.Enabled = True
ElseIf GetKeyState(vbKeyF2) And KEY_PRESSED Then
Timer1.Enabled = False
End If
End Sub
Me da error en la parte de:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF9 Then
Call Command1 Timer1.Enabled = True
End If
Justamente en la de Timer1.Enabled=True es donde me da error
Si alguien me dice donde esta el error se lo agradeceria
Al final postee para nada ya se donde esta el error grax