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 :-).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top