Click here to Skip to main content
15,898,992 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have an application that looks like ordinary form (Form1), but now form became to big, so the only options that i see is to convert it to MDI.
How to change it? Do i need to start all over again? Will i also have to modify the code?
Posted
Comments
Member 4347041 27-Jun-13 3:33am    
I was thinking to do like this:
http://www.energetska-ucinkovitost.si/energetska-ucinkovitost-v-stavbah/izracun-energijske-bilance-stavbe/programska-oprema/

Where you don't have one form but 2 or 3 forms that you can move above or under the other,... so you can get more space.
I wrote my app on my screen resolution and when i tested on other pc (resolutions) i had a big problem. labels were moved, spaces between labels, textboxes,... where changed,..., it cut one third of a form and so on. That is why i was thinking to use MDI, so i can have "desktop" in it, with multiple forms, panels,...

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
 
Share this answer
 
Comments
Maciej Los 26-Jun-13 18:27pm    
I'm a bit confused, why people still asking about MDI, if you have mentioned so many times that is not good idea...
+5!
Changing the application to MDI will not allow you to make a bigger form. The largest form you can make in Visual Studio is your screen resolution + 12px on the top and bottom.

So if your resolution is 1024x768, the biggest form you can make is 1032x780. This is a limitation of the Windows Forms designer and one that has been a pain in my ass for a long time (I write a lot of Kiosk applications where the Kiosk screen is larger than my development screen).

The better thing to do is to put a panel on your form, put all your controls in the panel, and set the panel to Auto Scroll. This will add a scroll bar on the form and be able to show more as you add more controls.

Or, you can re-design your UI to be less busy, using sub-forms and other ways to display data (tabs, panels, etc).
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Jun-13 17:11pm    
I would say, strong dependence on screen size (it's not correct to call it "resolution") is a sing of a bad design/approach, and using MDI is even worse.
Please see my answer where I explain it.
(I voted 4 this time.)
—SA
Ron Beyer 26-Jun-13 18:23pm    
Sergey-
I'd love to discuss this with you, see Discussion in the forums
Sergey Alexandrovich Kryukov 26-Jun-13 19:33pm    
I put some basic thought; thank you for the invitation.
—SA

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