问题描述
我在 Visual C# 中使用哪个控件来创建窗格窗口?
Which control do I use in Visual C# to create a paned window?
这就是我的意思:
http://effbot.org/tkinterbook/panedwindow.htm
推荐答案
正如我在评论中提到的,您可以使用 SplitContainer-Control 将您的窗口划分为多个部分/窗格.
As mentioned in my comment you can use the SplitContainer-Control to divide your windows in multiple sections/panes.
您可以使用它的 Dock-Property 将宽度和高度设置为父尺寸
You can use its Dock-Property to set the width and height to the parents size
splitContainer1.Dock = DockStyle.Fill //Sets the size to the one's of the parent container
您还可以使用以下代码设置拆分器是垂直还是水平:[MSDN]
Further you can set if the splitter is vertical or horizontal with following code:[MSDN]
splitContainer1.Orientation = Orientation.Horizontal; //Or Orientation.Vertical
要显示 SplitContainer 的边框,您可以使用 BorderStyle-Property:
To show the borders of the SplitContainer you can use the BorderStyle-Property:
splitContainer1.BorderStyle = BorderStyle.Fixed3D; //3d-Effect
//BorderStyle.FixedSingle; //Shown in the example
//BorderStyle.None; //No borders
最后你可以得到以下结果,例如:
Finally you can get following result for example:
这篇关于Visual C# 中的窗格窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!