By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,208 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Iterating all open forms

P: n/a
Hi

I have a an application that opens up forms as it runs. So at any time 5
forms may be open for example, each form represents a room.

I need a way to iterate through these forms so that someone doesn't open the
same one twice. Is there a built in way of doing this? c#, .net. So i would
iterate and check the requested room id and say if a form representing that
room is open, just make that one the focus.

Thanks
Jan 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sorry found how...

For anyone else who doesnt know:

FormCollection fc = Application.OpenForms;

foreach (Form frm in fc)
{
//iterate through
}

"Daniel" <Da*****@vestryonline.comwrote in message
news:uz**************@TK2MSFTNGP05.phx.gbl...
Hi

I have a an application that opens up forms as it runs. So at any time 5
forms may be open for example, each form represents a room.

I need a way to iterate through these forms so that someone doesn't open
the same one twice. Is there a built in way of doing this? c#, .net. So i
would iterate and check the requested room id and say if a form
representing that room is open, just make that one the focus.

Thanks

Jan 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.