473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Multiple mdi Children

4
I have a main window (form) wich is an mdi container.
i can open one form which mdi parent is this main window like this:

NewDistribution distr = new NewDistribution();
distr.MdiParent = this;
distr.Show();

in this New Distribution i have a new button wich opens another form... how do i set the second form to be opened in the main window's mdi container?
cause it is opening like a separate form...
Attached Images
File Type: jpg mdi.jpg (10.5 KB, 608 views)
Aug 18 '09 #1
3 5121
cloud255
427 Expert 256MB
Hi

You need to do this in the event handler of the button which will open the second form.
You simply create a new instance of the form you wish to show and set its MdiParent parent property equal to your main form and call the show() method of the new form. See below for an example:

Expand|Select|Wrap|Line Numbers
  1. //MainWindowName is the name of your main MDI parent form
  2. Form newMDIChildForm = new Form();
  3. newMDIChildForm.MdiParent = Application.OpenForms["MainWindowName"];
  4. newMDIChildForm.Show();
Hope this helps
Aug 18 '09 #2
tlhintoq
3,525 Expert 2GB
The thumbnail is tiny and of no real value. Can you post a full size image?

Do I understand your question correctly?
You have a parent form that opens a child form.
You have a button on the child.
You want the child's button to cause another form to open, as another child of the main - not as a child of the child.

Does that sound right?
Aug 18 '09 #3
HashPe
4
Yes, it helped, Thank You,
meanwhile i found a provisory solution for me...

Expand|Select|Wrap|Line Numbers
  1. Form newMDIChildForm = new Form();
  2. newMDIChildForm.MdiParent = this.MdiParent;
  3. newMDIChildForm.Show();
@cloud255
Aug 19 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Sandman | last post by:
I have a script that generates a hierarchical menu, but I am having problems assigning styles to each manu items different possible states. The possible states a menu item can be in is (and all of...
20
by: km | last post by:
Hi all, In the following code why am i not able to access class A's object attribute - 'a' ? I wishto extent class D with all the attributes of its base classes. how do i do that ? thanks in...
1
by: Tarvos{k} | last post by:
Greetings all, I am working on a new db that will be used as an address book. I wanted to have a field named Child, but I wanted to allow for the possibilites of more than one child for the...
3
by: Nathan Sokalski | last post by:
When I view any page in my application a second time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize) +313...
7
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
0
by: joebob8000 | last post by:
This seems like a simple task, but my 6 year old roots in classic ASP must be causing me trouble with my current problem. I am looking to provide a search for users in which they can select...
1
by: Vivienne | last post by:
Hi there This is a hard problem that I have - I have only been using sql for a couple of weeks and have gone past my ability level quickly! The real tables are complex but I will post a simple...
4
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one...
2
by: scriptlearner | last post by:
OS: Solaris 9 Python Version: 2.4.4 I need to log certain data in a worker thread; however, I am getting an error now when I use two worker threads. I think the problem comes from the line...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.