Standard way of tracking dynamically created forms?

G

Guest

I have a main form that can create and display multiple other (sub)forms at
the click of a button. Each time a new subform is created, I want the main
form to increment a counter to indicate how many forms of that type are
active in memory. But in order for this to work, I need to be able to
decrement the counter when a subform is closed using the subform's x control.

I'm sure this is frequently done, so I am interested to learn how this is
typically/best accomplished.

Thanks.
 
G

Guest

You could keep a static Hashtable in the main form, adding or subtracting an
entry for each "subform" when they are created or destroyed.
Peter
 

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

Top