Click here to Skip to main content
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 22: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 365
1 Sergey Alexandrovich Kryukov 319
2 CPallini 275
3 DamithSL 214
4 Maciej Los 185
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 14 Apr 2013
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