将应用程序从Form更改为MDI [英] Change application from Form to MDI

查看:93
本文介绍了将应用程序从Form更改为MDI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个看起来像普通形式(Form1)的应用程序,但现在形式变得很大,所以我看到的唯一选项是将其转换为MDI。

如何更改它?我需要重新开始吗?我是否还需要修改代码?

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?

推荐答案

这是一个想法:谁需要MDI?为什么要折磨自己并吓跑你的用户?

帮自己一个大忙:根本不要使用MDI。没有它,您可以更轻松地实现设计,质量更好。 MDI甚至被微软高度劝阻,事实上,微软将其从WPF中删除并且很难支持它。更重要的是,如果您使用MDI,您将吓跑所有用户。只是不要。请参阅:

http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages [ ^ ],

如何在WPF中创建MDI父窗口? [ ^ ]。



我可以解释做什么。请看我过去的答案:

如何在WPF中创建MDI父窗口? [解决方案2 ],

关于在WPF中使用MDI窗口的问题 [ ^ ],

麦当劳给出错误 [ ^ ],

如何设置子窗体最大化,最后一个子窗体最小化 [ ^ ]。



-SA
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


将应用程序更改为MDI将不允许您创建更大的表单。您可以在Visual Studio中创建的最大窗体是顶部和底部的屏幕分辨率+ 12px。



因此,如果你的分辨率是1024x768,你可以制作的最大形式是1032x780。这是Windows窗体设计师的限制,长期以来一直困扰着我(我在Kiosk屏幕比我的开发屏幕更大的Kiosk应用程序)。



最好的办法是在表单上放置一个面板,将所有控件放在面板中,然后将面板设置为Auto Scroll。这将在表单上添加一个滚动条,并且可以在添加更多控件时显示更多。



或者,您可以重新设计UI以减少忙碌,使用子表单和其他方式显示数据(标签,面板等)。
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).


这篇关于将应用程序从Form更改为MDI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆