SplitContainer.Panel1 属性

定义

获取 SplitContainer 的左侧面板或上部面板(根据 Orientation 而定)。Gets the left or top panel of the SplitContainer, depending on Orientation.

public:
 property System::Windows::Forms::SplitterPanel ^ Panel1 { System::Windows::Forms::SplitterPanel ^ get(); };
public System.Windows.Forms.SplitterPanel Panel1 { get; }
member this.Panel1 : System.Windows.Forms.SplitterPanel
Public ReadOnly Property Panel1 As SplitterPanel

属性值

如果 OrientationVertical,则获取 SplitContainer 的左侧面板。If Orientation is Vertical, the left panel of the SplitContainer. 如果 OrientationHorizontal,则获取 SplitContainer 的上部面板。If Orientation is Horizontal, the top panel of the SplitContainer.

注解

使用 "Panel1" 属性可配置垂直 SplitContainer 的左侧面板或水平 SplitContainer的顶部面板。Use the Panel1 property to configure the left panel of a vertical SplitContainer or the top panel of a horizontal SplitContainer. 例如,您可以通过更改 "Panel1MinSize" 属性的值来指定面板的最小大小,将 "FixedPanel" 属性设置为 "Panel1 以便在调整容器大小时面板保持相同大小,也可以获取或设置面板的 BackgroundImageBackgroundImageLayout 属性。For example, you can specify the minimum size of the panel by changing the value of the Panel1MinSize property, set the FixedPanel property to Panel1 so that the panel remains the same size when the container is resized, or you can get or set the panel's BackgroundImage and BackgroundImageLayout properties.

不能从 SplitContainer中删除 Panel1You cannot remove Panel1 from the SplitContainer.

备注

如果 Panel1Panel2 不包含可接收焦点的控件,则焦点在被单击时保持在拆分器上。If Panel1 or Panel2 contains no control that can receive the focus, the focus remains on the splitter when it is clicked. 若要将焦点更改为 Panel1Panel2,请将 Panel2TabIndex 属性设置为0,将 TabIndexPanel1 属性设置为1。To change the focus to Panel1 or Panel2, set the TabIndex property of Panel2 to 0 and the TabIndex property of Panel1 to 1.

如果 Panel1Panel2 不包含可接收焦点的控件,则焦点在被单击时保持在拆分器上。If Panel1 or Panel2 contains no control that can receive the focus, the focus remains on the splitter when it is clicked. 若要将焦点更改为 Panel1Panel2,请将 Panel2TabIndex 属性设置为0,将 TabIndexPanel1 属性设置为1。To change the focus to Panel1 or Panel2, set the TabIndex property of Panel2 to 0 and the TabIndex property of Panel1 to 1.

适用于

另请参阅