Shutdown Utility (Tutorial)

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.
2 posts Page 1 of 1
Contributors
MANSQN
VIP - Donator
VIP - Donator
Posts: 159
Joined: Sat Sep 17, 2011 11:33 pm

Shutdown Utility (Tutorial)
MANSQN
This tutorial will show you how to create a Shutdown utility.

Click on Project next to Create:

Click on Windows Form Application, and name the project "Shutdown Utility " and then click Ok.

Change the form name to whatever you want.

Set the maximize box and minimize box property to “false”. Change formborderstyle to FixedSingle.

Add 3 Groupboxes and 3 buttons to the form.

Rename the ff:

GroupBox1 = Shutdown Groupbox2 = Restart Groupbox3 = Log Off

Button1 = Click here to Shut Down Button2= Click here to restart Button3=Click here to Log Off.

Now to add the code:

Double click on “Click here to shut down” button. Enter the code
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

        Shell("shutdown -s")

 

    End Sub
Double Click on “Click here to Restart” button. Enter the code.
Code: Select all
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

 

        Shell("shutdown -r")

 

    End Sub
Double Click on “Click here to logoff button”. Enter the code:
Code: Select all
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

 

        Shell("shutdown -l")

 

    End Sub
Debug and test it. It should work.

-Thanks-
Last edited by MANSQN on Tue Feb 14, 2012 10:24 pm, edited 1 time in total.
User avatar
mrstean
VIP - Donator
VIP - Donator
Posts: 12
Joined: Sat Jun 18, 2011 4:12 pm

Re: Shutdown Utility (Tutorial)
mrstean
Windows already have a shutdown button :P but thx for this anyways.
2 posts Page 1 of 1
Return to “Tutorials”