?
Solved

Which forms are showed?

Posted on 2006-06-09
2
Medium Priority
?
234 Views
Last Modified: 2010-04-16
Hi!
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.
0
Comment
Question by:tunhien
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
mrsreeraj earned 1200 total points
ID: 16875571
Check this link out
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c4c.aspx

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;
                break;
           }
      }
      if( childForm != null)
      {
           childForm.Show();
           childForm.Focus();
      }
      else
      {
           childForm = new MyChildForm();
           childForm.MdiParent = this;
           childForm.Show();
           childForm.Focus();
      }
 
0
 
LVL 1

Expert Comment

by:mrsreeraj
ID: 16875585
or u could use singleton pattern
example code is here
http://www.codeproject.com/csharp/singletonforms.asp
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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