jms, as lavolpe said, something like this, this just add / subtract the value while pressing button, just add 2 cmd button, 1 label, 1 timer
Code:Dim Cnt As Integer, Cmd As Integer Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Cmd = 1 Timer1.Enabled = True End If End Sub Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Timer1.Enabled = False End If End Sub Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Cmd = 2 Timer1.Enabled = True End If End Sub Private Sub Command2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Timer1.Enabled = False End If End Sub Private Sub Form_Load() Timer1.Interval = 10 Timer1.Enabled = False End Sub Private Sub Timer1_Timer() If Cmd = 1 Then Cnt = Cnt - 1 ElseIf Cmd = 2 Then Cnt = Cnt + 1 End If Label1.Caption = Cnt End Sub





Reply With Quote