Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows Forms MDI
Hi all,
 
In my project I have a MDI_Parent form where I can show several MDI_Child.
 
When opening any Child_Form it is running well but when closing the one at the front, only the MDI_Parent appears and the Child_Form titles appear with the boxes minimize , maximize and Exit.
 
On maximize box click the child form appears but with errors in design.
 
that's my code when showing the form at the beginning.
 
Child_Form Child = new Child_Form();
Child.MdiParent = this;
Child.Show();
 
Please can anyone help me ?
 
Thanks in advance.
Smile | :)
Posted 26-Mar-11 5:29am
Edited 28-Jul-11 1:00am
v10
Comments
Dalek Dave at 27-Mar-11 10:25am
   
Edited for Spelling and Readability.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can start by making sure any third party your child form uses are installed.
Try to open the form in design mode and post the error that occurs here and maybe someone can help you.
  Permalink  
Comments
Dalek Dave at 27-Mar-11 10:25am
   
Sage Advice.
Abhinav S at 27-Mar-11 10:52am
   
Thank you.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I am sure there will be more help available if you were to post some of the code.
 
Hard to know what is going on without it, but are you calling the forms correctly? Are there any DLLs attached to the form? Where is the Focus?
 
More information = More Help.
  Permalink  
Comments
Abhinav S at 27-Mar-11 10:52am
   
Good point. 5.
Dalek Dave at 27-Mar-11 11:11am
   
Cheers.
Michael Waguih at 28-Mar-11 3:30am
   
Each child form appear very clear when trying to show it, there isn't any problem here .
My problem is when opening more than one child and closing the one at the front , the mdi parent only appears and the other child form is not appearing only ribbon which include the title and the minimize,maximize and close boxes of the child form is still there.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I think you are using like follow:
 
At an event of a control of MDI use follow:
 child ch=new child();
  ch.MdiParent = this;
 ch.Show();
 
First you should have a Form, enable it's IsMdiContainer=true.
child is a normal form.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

I found the solution by assigning the Start position property of the child form to "center parent"
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 410
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 105
4 PIEBALDconsult 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 28 Jul 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100