Count of opened windows forms

  • Thread starter Thread starter Gennady
  • Start date Start date
G

Gennady

1. How can I get count(or list) of my opened forms in application
2. How can I enforce my application close all forms

Thanks
Gennady
 
* "Gennady said:
1. How can I get count(or list) of my opened forms in application
2. How can I enforce my application close all forms

You will have to maintain a collection of your forms somewhere and add
new forms when they are opened and remove them when they are closed.
 
Another method maybe would be to subscribe each form's close method to a
delegate.
Within each forms closed event handler remove them from the delegate.
Therefore the delegate list will only fire any forms close methods if they
are open.

Do you think this is feasible Herfried?

--


Br,
Mark Broadbent
mcdba , mcse+i
=============
 
* "Mark Broadbent said:
Another method maybe would be to subscribe each form's close method to a
delegate.
Within each forms closed event handler remove them from the delegate.
Therefore the delegate list will only fire any forms close methods if they
are open.

Do you think this is feasible Herfried?

Basically, it should work :-).
 
Back
Top