If the first form is your main form, unloading it will terminate your
application. So, what you need to do, is just hide this form, and then
unload it when you close the second form.
Eg.
'Create a new instance of the second form
Dim MySecondForm As New Form2
'Set the form owner
MySecondForm.Owner = Me
'Hide this form
Me.Hide()
'Show the second form
MySecondForm.Show()
In the Form2_Closed event, you could have the following:
'Unload the main form
Me.Owner.Close()
This appears to work in a small test project I created, but I'm not sure if
this is the correct practice. I hope someone else can confirm this is
correct, or offer the correct way of doing this :-)
Cheers,
Mun
--
Munsifali Rashid
http://www.munsplace.com/
"V.Boomessh" <an*******@discussions.microsoft.com> wrote in message
news:0a****************************@phx.gbl...
Hai,
The code just ends the application and comes out. It is
not solving the problem.
regards,
V.Boomessh