Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using VB 2010 express. I have created 2 forms. I got a button to each form with me.hide and form2.show and
me.hide and form1.show code and its working fine.But if i click the exit box in the second form , it dissapears and the first form is hidden what do i have to do to avoid that ?
Posted

VB
Public Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

    Form1.Show()

End Sub
 
Share this answer
 
Comments
Juljano 16-Dec-11 11:56am    
Thank You!!
There are number of events fired when form get's closed. you can use that.
one of the event is FormClosing. make a form1 visible when you close form2.
Means when you close your form with crossbutton[X] then form1 will load.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900