codice:'Sono necessari: 'Un controllo Timer '4 Pulsanti 'Una textbox Dim MyStrTmp Dim Pausa As Boolean Private Sub Command1_Click() Timer1.Enabled = True End Sub Private Sub Command2_Click() Timer1.Enabled = False End Sub Private Sub Command3_Click() Pausa = Not Pausa End Sub Private Sub Command4_Click() Timer1.Enabled = False Text1.Text = "" MyStrTmp = 0 End Sub Private Sub Form_Load() Command1.Caption = "Start" Command2.Caption = "Stop" Command3.Caption = "Pause" Command4.Caption = "Reset" Text1.Text = "" Timer1.Interval = 1000 Timer1.Enabled = False Text1.Text = "" MyStrTmp = Time End Sub Private Sub Timer1_Timer() If Not Pausa Then tmptrascorso = Time - MyStrTmp Text1.Text = Format(tmptrascorso, "hh:nn:ss") End If End Sub

Rispondi quotando