Программа таймер

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Private Sub Command1_Click()
Timer1.Enabled = False
End Sub

Private Sub Command2_Click()

Timer1.Enabled = True

End Sub

Private Sub Form_Load()
Text1_Change
Text2_Change
Text3_Change

Shell ("wscript.exe ""scripts\connect2.vbs"""), vbNormalFocus
Shell "userdisconn.bat"
Timer1.Enabled = True
End Sub

Private Sub Text1_Change()
If Text1.Text >= 0 And Text1.Text < 12 Then
Label1.Caption = Text1.Text

Else
MsgBox "значение дб от 0 до 12"
End If

End Sub

Private Sub Text2_Change()
If Text2.Text >= 0 And Text2.Text < 60 Then
Label2.Caption = Text2.Text

Else
MsgBox "значение дб от 0 до 60"
End If

End Sub

Private Sub Text3_Change()
If Text3.Text >= 0 And Text3.Text < 60 Then
Label3.Caption = Text3.Text

Else
MsgBox "значение дб от 0 до 60"
End If

End Sub

Private Sub Timer1_Timer()

If Label3.Caption = 0 And Label2.Caption = 0 And Label1.Caption = 0 Then
'MsgBox "beep"
Timer1.Enabled = False
Shell "turnoff.bat", vbNormalFocus
Exit Sub
End If

If Label3.Caption = 0 Then

Label3.Caption = 59

''минуты
If Label2.Caption = 0 Then

If Label1.Caption <> 0 Then
Label2.Caption = 59
Label1.Caption = Label1.Caption - 1
End If
Else
Label2.Caption = Label2.Caption - 1
End If
''
Else
Label3.Caption = Label3.Caption - 1
End If

End Sub

georgeyurch