我可以在拆分conatiner中显示多个表单 [英] Can I display a multiple form in split conatiner

查看:61
本文介绍了我可以在拆分conatiner中显示多个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如:



i有4种表格



1表格是我的主要表格
在我的主要表格中我有3个按钮,当我点击每个按钮时它会在一个面板中显示3个表格



什么我试过了:



i只在一个面板中显示一个表单,但它只显示一个表单。

for example:

i have 4 forms

1 form is my main form
in my main form i have a 3 buttons and when i click every button it will display the 3 form in a one panel

What I have tried:

i just display a form in one panel but it only display one form.

推荐答案

原则上,如果将 Form.TopLevel 修改为false,否则将在任何其他控件中将其设为父项时抛出异常。



不要这样做。实际上没有任何意义。即使类表单 Control ,父子关系也会有效地完成对表单的解除。他们只是不是任何东西的孩子。正式地,您可以按照我在第一段中的说明进行操作,并且还必须删除所有非客户区域。你不能从这些麻烦中获得任何好处。表格确实设计在顶层。



你真的不需要它。如果您通过其他控件(例如 Panel )替换您所描绘的形式,则可以轻松实现相同的行为。一个主要形式(不包括一些有限数量的模态形式)将使您成为最佳设计。如果可以像Visual Studio IDE一样有条理和方便。



-SA
In principle, if you modify Form.TopLevel to false, otherwise an exception will be thrown on any attempt to parent it in any other control.

Don't do it. It makes practical no sense at all. Even though the class Form is Control, parent-child relationship is effectively done defunct for forms. They are just not designed to be children of anything. Formally, you can do it as I explained in my first paragraph, and also will have to remove all non-client areas. You cannot get any benefits from all these troubles. Forms are really designed to be on top level.

And you don't really even need it. You can easily achieve the same behavior if you replace what you pictured as forms by other controls, such as Panel. One single main form (not counting some limited number of modal forms) will make you the best design. If can be even as organized and convenient as that of Visual Studio IDE.

—SA


这篇关于我可以在拆分conatiner中显示多个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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