PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
How do I allow MDI Child Form A to know if MDI Child Form B is open in C#?
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
How do I allow MDI Child Form A to know if MDI Child Form B is open in C#?
![]() |
How do I allow MDI Child Form A to know if MDI Child Form B is open in C#? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Greetings:
I have an MDI application. I need for MDIChildFormA to be able to determine if MDIChildFormB is open, so I can display a message to finish edits in and close MDIChildFormB before I proceed with a delete operation in MDIChildFormB. How do I determine from MDIChildFormA if MDIChildFormB is open? Thanks!! Kent |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi Kent,
you can use the MdiParent property of MDIChildFormA to get the MDI container, which holds a list of all currently opened windows in its MdiChildren property, so something like foreach(Form mdiChildForm in this.MdiParent.MdiChildren) { if (mdiChildForm == MDIChildFormB) { //do your processing here } } Of course, you cannot use the above comparison because you will likely not have a reference to it, but I'm sure you'll find some properties that uniquely identify the form in question. Michael "kstuver" <whiteboard2004-programmer@yahoo.com> schrieb im Newsbeitrag news:1134410237.051933.57480@z14g2000cwz.googlegroups.com... > Greetings: > > I have an MDI application. I need for MDIChildFormA to be able to > determine if MDIChildFormB is open, so I can display a message to > finish edits in and close MDIChildFormB before I proceed with a delete > operation in MDIChildFormB. > > How do I determine from MDIChildFormA if MDIChildFormB is open? > > Thanks!! > Kent > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

