|
-
Sep 19th, 2006, 10:21 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] closing two form
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?
-
Sep 19th, 2006, 10:26 PM
#2
Hyperactive Member
Re: closing two form
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.
-
Sep 19th, 2006, 10:28 PM
#3
Re: closing two form
ahh never use "END" !!!! Use "Unload Me". Ask MartinLiss why, i forgot
My usual boring signature: Something
-
Sep 19th, 2006, 10:29 PM
#4
Thread Starter
Fanatic Member
Re: closing two form
 Originally Posted by Zeratulsdomain
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.
ohh i didnt try that 
thank you
br
-
Sep 20th, 2006, 04:20 AM
#5
Re: [RESOLVED] closing two form
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|