how to close a 2 two form?
ex.
VB Code:
Form Load() Form2.show End
when the form1 is closed i want also the form2 to be closed?
Printable View
how to close a 2 two form?
ex.
VB Code:
Form Load() Form2.show End
when the form1 is closed i want also the form2 to be closed?
VB Code:
Private Sub Form_Unload(Cancel As Integer) End End Sub
When ever you close form1, it will end your whole application and another form you have open.
ahh never use "END" !!!! Use "Unload Me". Ask MartinLiss why, i forgot :p
ohh i didnt try that ;)Quote:
Originally Posted by Zeratulsdomain
thank you
br
as dclamp said, don't use End - all objects / connections / etc must be properly set to Nothing / Closed / Unloaded / etc
if you want them to both unload when either one closes then it's as simple as doing:VB Code:
' In Form1 Private Sub Form_Unload(Cancel As Integer) Unload Form2 End Sub ' In Form2 Private Sub Form_Unload(Cancel As Integer) Unload Form1 End Sub