Reputation: 5
I'm trying to make a VB.net program and I have added this code to the main form:
Me.Hide()
When Form2 opens, the main form hides itself, but if I close Form2 the main Form won't reappear, though I can see it in the Task Manager.
What should I add to make the main form appear again if Form2 closes?
Upvotes: 0
Views: 53
Reputation: 1404
Use Form2's FormClosing
event to show your main form.
Private Sub Form2_FormClosing(sender as Object, e as FormClosingEventArgs) Handles Form2.FormClosing
Form1.Show()
End Sub
Upvotes: 1