Which forms are showed?

Posted on 2006-06-09
Last Modified: 2010-04-16
I have a question:
In mainform 's source code, how can I know which other forms are showed, and how can I control these forms from mainform, such as calling a method in each of these forms?

Plz help me!
Thank you very much.
Question by:tunhien
  • 2

Accepted Solution

mrsreeraj earned 300 total points
ID: 16875571
Check this link out

within MDI form use this code
child form is MyChildForm

MyChildForm childForm = null;
    foreach(Form f in this.MdiChildren)
          if(f is MyChildForm)
               // found it
                childForm = (MyChildForm) f;
      if( childForm != null)
           childForm = new MyChildForm();
           childForm.MdiParent = this;

Expert Comment

ID: 16875585
or u could use singleton pattern
example code is here

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question