Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Format(TimeSerial(0, 0, Sec - SecP), "mm:ss")
If SecP >= Sec Then
Shell("shutdown -s -t 0")
Else
SecP = SecP + 1
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
On Error GoTo err
If ComboBox1.Text > 60 Then
MsgBox("60분 이내로 입력해주세요.")
GoTo err
End If
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
ComboBox1.Text = ""
Label1.Text = "남은시간"
ProgressBar1.Value = 0
Shell("shutdown -a")
End Sub