Code to close Program?Hey all Coding/making programs Nerds! Ok, lets say i put a button in, and it's name (NOT text) is: Button1. I jsut want to know the code like you click it and the program closes! It is simple, but i am crap =) Thanks [Visual basics Microsoft 2008 Express Edition™]
Originally Posted by Yuerno Hey all Coding/making programs Nerds! Ok, lets say i put a button in, and it's name (NOT text) is: Button1. I jsut want to know the code like you click it and the program closes! It is simple, but i am crap =) Thanks [Visual basics Microsoft 2008 Express Edition™] Here you go: Code: Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click End End Sub
Originally Posted by Heroblind Here you go: Code: Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click End End Sub I heard that End Is a horrible way to close the app. You can try Me.Close()
Yeah. "Me.close" is how you do it. Double click the button then it'll bring you to the code. Just type. Me.close
Here is a more detailed answer: Me.Close() will just close the form you clicked X on (might be the whole application if it's only one form. Close() will close the whole application. Application.Exit() will close the whole application as well. The Application. class(?) has alot of options though, like Application.Restart(), etc.
Originally Posted by jimmydang09 msgbox ("Thanks For Using My Device") me.close () I meant the click the button and the whole program closes. Hold on, i will try HeroBlind's way. Edit*: Thanks Jimmy anyway, soemthing else i learnt
The two ways to close the whole application (all forms) vb2008 Code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1Click Close() End Sub vb6.0 Code: Private Sub Command1_Click() End End Sub Edit: I think you got answered never mind