This is my first tutorial on visual basic 2008. Any question please leave comment.
Tutorial on shutdown timer
coding:
"
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = Nothing Then
MsgBox("Please insert a value")
Else
Button3.Enabled = True
Timer1.Start()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox1.Text = Nothing Then
MsgBox("Please insert a value")
Else
Button3.Enabled = True
Timer2.Start()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer1.Stop()
Timer2.Stop()
Button4.Enabled = False
MsgBox("Process Cancel")
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If TextBox1.Text = "0" Then
Timer1.Stop()
Button4.Enabled = True
Button3.Enabled = False
Shell("shutdown -s")
Else
TextBox1.Text = TextBox1.Text - 1
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If TextBox1.Text = "0" Then
Timer2.Stop()
Button4.Enabled = True
Button3.Enabled = False
Shell("shutdown -r")
Else
TextBox1.Text = TextBox1.Text - 1
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Shell("shutdown -a")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button4.Enabled = False
Button3.Enabled = False
End Sub
End Class
"
Video:
Files:
Password: Demonoid
No comments:
Post a Comment