stephenz43
asked on
Close 2 Forms on Exit
Hey guys
Ive got a formA that has a button that fires another form (reference Card) . I want to close both formA and formReference when formA is exited. Cant seem to get it right.
Thanks
Ive got a formA that has a button that fires another form (reference Card) . I want to close both formA and formReference when formA is exited. Cant seem to get it right.
Thanks
If FormA if startup form, then you can write Me.Close() or End in FormA to close all forms.
you have to keep the reference to the other form, and close that.
http://209.85.135.104/search?q=cache:yjjQ9KwlDv0J:www.csse.monash.edu.au/courseware/cse5930/Exercises/VBNETExercise4.doc+vb.net+open+and+close+child+form&hl=en&gl=lu&ct=clnk&cd=2&client=firefox-a
http://209.85.135.104/search?q=cache:yjjQ9KwlDv0J:www.csse.monash.edu.au/courseware/cse5930/Exercises/VBNETExercise4.doc+vb.net+open+and+close+child+form&hl=en&gl=lu&ct=clnk&cd=2&client=firefox-a
ASKER
formA is not a startup form nor a parent
>Ive got a formA that has a button that fires another form
that means that formA is the "parent" of the other one...
I guess a confusion of terms here.
As formA fires the other form, it should have/retain that form's reference. and using that, it can close it also at any time.
that means that formA is the "parent" of the other one...
I guess a confusion of terms here.
As formA fires the other form, it should have/retain that form's reference. and using that, it can close it also at any time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bit late but you can lop through the My.Application.OpenForms and close them fromt he main form.
"Loop"