Click here to Skip to main content
Rate this: bad
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;
frm.WindowState = FormWindowState.Normal;
frm.WindowState = FormWindowState.Maximized;
Thanks and Regards
Madhukumar N
Posted 28-May-13 19:22pm

1 solution

Rate this: bad
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:[^],
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[^].
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:

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

  Print Answers RSS
0 Mika Wendelius 241
1 Abhinav S 155
2 Peter Leow 140
3 Sergey Alexandrovich Kryukov 135
4 Kornfeld Eliyahu Peter 115
0 Sergey Alexandrovich Kryukov 8,613
1 OriginalGriff 6,536
2 Peter Leow 3,727
3 Zoltán Zörgő 3,456
4 Richard MacCutchan 2,442

Advertise | Privacy | Mobile
Web01 | 2.8.150123.1 | Last Updated 29 May 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