form.show & me.close

timtom1

Member
Joined
Jun 12, 2006
Messages
24
Programming Experience
Beginner
I have a button that opens a new form I would like to close the previous form after the button is pressed but it closes the entire project.
VB.NET:
[COLOR=#0000ff] [/COLOR]
Private[SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] Button1_Click([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] UploadButton.Click
[SIZE=2]form1.Show()
me.close()
[/SIZE][/SIZE]


 
Sounds like the Project properties are set to end when the first form is closed.

Goto Project properties and change to "Close Project when last form closes" or somthing to that nature.
 
Back
Top