• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

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
0
stephenz43
Asked:
stephenz43
  • 2
  • 2
  • 2
  • +1
1 Solution
 
Praveen KumarArchitectCommented:
If FormA if startup form, then you can write Me.Close() or End in FormA to close all forms.
0
 
stephenz43Author Commented:
formA is not a startup form nor a parent
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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.
0
 
Praveen KumarArchitectCommented:
try this..

Dim f As New formReference

Sub Button_Click(.................)
f.Show()
End Sub

Form1_FormClosing(.................)
     f.Close()
End Sub
0
 
Kinger247Commented:
Bit late but you can lop through the My.Application.OpenForms and close them fromt he main form.
0
 
Kinger247Commented:
"Loop"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now