SplitContainer.FixedPanel 属性

定义

获取或设置在调整容器大小时将大小保持不变的 SplitContainer 面板。

C#
public System.Windows.Forms.FixedPanel FixedPanel { get; set; }

属性值

FixedPanel 值之一。 默认值是 None

例外

分配的值不是 FixedPanel 值之一。

示例

下面的代码示例演示了一个水平拆分器,其顶部面板定义为 , FixedPanel 因此它不会随容器一起调整大小。 还显示了水平拆分器的其他基本属性。 此示例是为 类提供的更大示例的 SplitContainer 一部分。

C#
// Basic SplitContainer properties.
// This is a horizontal splitter whose top and bottom panels are ListView controls. The top panel is fixed.
splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
// The top panel remains the same size when the form is resized.
splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
splitContainer2.Location = new System.Drawing.Point(0, 0);
splitContainer2.Name = "splitContainer2";
// Create the horizontal splitter.
splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
splitContainer2.Size = new System.Drawing.Size(207, 273);
splitContainer2.SplitterDistance = 125;
splitContainer2.SplitterWidth = 6;
// splitContainer2 is the third control in the tab order.
splitContainer2.TabIndex = 2;
splitContainer2.Text = "splitContainer2";

注解

使用此属性可以指定当用户调整容器大小时,哪个 SplitContainer 面板保持相同的大小。

适用于

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另请参阅