Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows Application
Hi Everyone,
 
Im Getting a Peculiar Problem here My Menu Form is the MDI Container here Im Opening a Form in Maximized Mode and on That Form a Button Click has Open another Maximized form but here im Getting a Error Thrown as Object Reference not set and its Taking me to a Dilogue What May Be the Issue Im Pasting here how im Calling the New Form.
 
Form frm = new Form();
frm.MdiParent = MdiParent;
this.Close();
frm.Show();
frm.WindowState = FormWindowState.Normal;
frm.WindowState = FormWindowState.Maximized;
 
Thanks and Regards
Madhukumar N
Posted 28-May-13 19:22pm

1 solution

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

Solution 1

Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
How to Create MDI Parent Window in WPF?[^].
 
I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF? [Solution 2],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].
 
—SA
  Permalink  
Comments
Madhukumar N at 29-May-13 0:53am
   
Actually My Application is not in WPF its simple Windows application can u help out?
Sergey Alexandrovich Kryukov at 29-May-13 0:58am
   
I already did. You only need to write my answers, not just titles. They are not really related to WPF.
 
There are a number of alternatives. It could be TabControl, some accordion-like panels, or simply hiding/showing panels; you can even make a docking UI much like Visual Studio. The simplest solution which also is very convenient for the users is TabControl:
http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.aspx
 
—SA

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

  Print Answers RSS
0 OriginalGriff 584
1 Maciej Los 275
2 DamithSL 233
3 Sergey Alexandrovich Kryukov 209
4 BillWoodruff 200
0 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 29 May 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