Click here to Skip to main content
15,881,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I am trying to open child forms within MDI Parent but it doesn't work on Windows XP.
But it is working on Windows 7.
Its throwing following Exceptions whenIi try to open mdi child forms within MDI Parent on Windows XP.

I am trying to do following...
C#
Child  ChildForm=new Child();
ChildForm.SuspendLayout();
ChildForm.mdiparent=this;
childForm.Show();
ChildForm.ResumeLayout();


Here I put this code on Parent Winforms button to open child form.
But it is getting following exception on Windows XP.
C#
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.Show()

how should i have to solve this problem..!
Posted
v3
Comments
OriginalGriff 11-Apr-13 3:36am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps the code you are using would help us, just a bit?
Use the "Improve question" widget to edit your question and provide better information.
Dnyanesh Wahiley 11-Apr-13 5:25am    
i m trying to do folowing access..
Child ChildForm=new Child();
ChildForm.SuspendLayout();
ChildForm.mdiparent=this;
childForm.Show();
ChildForm.ResumeLayout();

here i put this code on Parent winforms button to open child form..
but its get following exception on windows XP

1 solution

i guess if you change your code a little bit as following then there should not be any problem

C#
Child  ChildForm=new Child();
ChildForm.mdiparent=this;
childForm.Dock=DockStyle.Fill;
childForm.Show();


i am sure it will work on both xp and win7.
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900