Does a form know which open forms are it's child?

  • Thread starter Thread starter Pierre
  • Start date Start date
P

Pierre

Hi all,

I have a form that i want to automatically close if it is idle after a
certain amount of time.

I can do that with no problem, but on that form there are four others forms
that can be open with button control.
Those form can also have button that can open orthers forms.

Is there a way to close all the child forms automatically with few lines of
code?

I don't want to put the code on each form since there are a lots of form in
this applciation.

Actually the main form close but all the otheres form stay open.

regards,

Pierre
 
No, there is no built-in property or collection that allows a form to know
which forms it may have opened. You'd need to code this into your main form
so that it remembers which forms it has opened, and then use the main form's
Close event to also close the other forms that it opened.
 
Back
Top