【发布时间】:2009-07-29 08:42:24
【问题描述】:
我有一个带有 TabControl 的表单。
在 TabControl 上动态添加标签页(仅供参考:这是关于不同动态加载模块的配置设置)。
现在我想要一种方法来获取表单 - 和/或表单上的 TabControl - 根据添加的 TabPage 的大小调整其大小。
While writing this I realize that this could be someway more complicated than I thought: Since the different TabPages can be different in size the Form does have to change its size whenever another TabPage is selected or I have to set it to the size最大的 TabPage 一次,这似乎是最好的方法。
当然,我可以通过将宽度和高度设置为合适的值来以编程方式设置大小,但首先我需要知道是否没有自动化的方法来解决我的问题,如果没有,实现这一点的最佳方法是什么。
我已经尝试过 AutoSize=true 但这并没有解决我的问题。 ;)
我正在使用 Visual Studio 2005 .Net 2.0 和 C#。
【问题讨论】: