09/09/09 8:35
dylan666
Mi servirebbe di rilevare il rilascio del bottone sinistro del mouse dopo che lo si è premuto. Per la pressione, grazie all'aiuto che ho avuto su questo forum, sono arrivato al seguente codice:
Per il rilascio credevosi potesse fare una cosa così:
Ovviamente non funziona... il timer non si ferma e continua a scrivere "Lasciato"... avete suggerimenti?
Vorrei evitare il Timer3.Interval = 0
Grazie
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Sub Form_Load() Timer1.Enabled = True Timer1.Interval = 1 End Sub Private Sub Timer1_Timer() If GetAsyncKeyState(vbKeyLButton) = -32768 Then MsgBox "premuto" End If End Sub
Per il rilascio credevosi potesse fare una cosa così:
Private Sub Timer2_Timer() If GetAsyncKeyState(vbKeyLButton) = -32768 Then 'MsgBox "premuto" Timer3.Enabled = True End If End Sub Private Sub Timer3_Timer() If GetAsyncKeyState(vbKeyLButton) = 0 Then MsgBox "lasciato" Timer3.Enabled = False End If End Sub
Ovviamente non funziona... il timer non si ferma e continua a scrivere "Lasciato"... avete suggerimenti?
Vorrei evitare il Timer3.Interval = 0
Grazie
aaa