VB 2008 Tutorial - Shutdown Manager

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
1 post Page 1 of 1
Contributors
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

Insert 3 Timers, 4 buttons, a label and a text box hehaho;

Name a Button1 into "Shutdown', Name a Button2 into "Restart", Name a Button3 into "Log Off, Name a Button3 into "Abort Action, name a label txt into " Time Till ShutDown (Seconds)"

type "10" into Textbox1 text

For all the Timers make a Interval 1000

Double click and insert this code into button1
Code: Select all
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = True
Timer1.Enabled = True
MsgBox("Note : Now your computer going to Shutdown. To cancel Shutdown just press (Abort) Button")
Double click and insert this code into button2
Code: Select all
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = True
Timer2.Enabled = True
MsgBox("Note : Now your computer going to Restart. To cancel Shutdown just press (Abort) Button")
Double click and insert this code into button3
Code: Select all
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = True
Timer3.Enabled = True
MsgBox("Note : Now your computer going to Log Off. To cancel Shutdown just press (Abort) Button")
Double click and insert this code into button4
Code: Select all
Button1.Enabled = True
Button2.Enabled = True
Button3.Enabled = True
Button4.Enabled = False
Timer3.Enabled = False
Timer2.Enabled = False
Timer1.Enabled = False
Shell("shutdown -a")
MsgBox("Note : Your acion is Aborted!")
Double click and insert this code into Timer1
Code: Select all
If TextBox1.Text = 0 Then
Shell("shutdown -s") 's is shutdown
Timer1.Enabled = False
Else
TextBox1.Text -= 1
End If
Double click and insert this code into Timer2
Code: Select all
If TextBox1.Text = 0 Then
Shell("shutdown -s") 'r means restart
Timer2.Enabled = False
Else
TextBox1.Text -= 1
End If
Double click and insert this code into Timer3
Code: Select all
If TextBox1.Text = 0 Then
Shell("shutdown -l") 'l log off
Timer3.Enabled = False
Else
TextBox1.Text -= 1
End If

*******************Thanks for reading my tutorial, I think this Tutorial will be most helpful to you!*******************

If you want any custom tutorial for you or you need any help in VS.NET, VB.NET, Software Coding, Designing and much more any help in Computer stuffs just ask me

Mostly i will help everyone in coding and design stuffs in on Computer

- Best regards hehaho;

- Tvs Praveen wahooo;

- Thanks CodeNStuff! for this amazing Website cooll;
1 post Page 1 of 1
Return to “Tutorials”