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
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
-Thanks-
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
Double Click on “Click here to Restart” button. Enter the code.Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Shell("shutdown -s")
End Sub
Code: Select all
Double Click on “Click here to logoff button”. Enter the code:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Shell("shutdown -r")
End Sub
Code: Select all
Debug and test it. It should work.Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Shell("shutdown -l")
End Sub
-Thanks-
Last edited by MANSQN on Tue Feb 14, 2012 10:24 pm, edited 1 time in total.
Windows already have a shutdown button :P but thx for this anyways.
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023