Click here to Skip to main content
11,706,455 members (47,196 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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...
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.
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 10-Apr-13 21:32pm
v3
Comments
OriginalGriff at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

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

i am sure it will work on both xp and win7.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 197
1 Sergey Alexandrovich Kryukov 141
2 chainerlt 110
3 ppolymorphe 71
4 Mika Wendelius 70
0 OriginalGriff 9,070
1 Sergey Alexandrovich Kryukov 8,413
2 CPallini 5,189
3 Maciej Los 4,746
4 Mika Wendelius 3,676


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 14 Apr 2013
Copyright © CodeProject, 1999-2015
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