Control.TopLevelControl 屬性

定義

取得沒有其他 Windows Form 父控制項的父控制項。Gets the parent control that is not parented by another Windows Forms control. 通常,這會是內含控制項最外層的 FormTypically, this is the outermost Form that the control is contained in.

public:
 property System::Windows::Forms::Control ^ TopLevelControl { System::Windows::Forms::Control ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.Control TopLevelControl { get; }
member this.TopLevelControl : System.Windows.Forms.Control
Public ReadOnly Property TopLevelControl As Control

屬性值

Control

Control,表示包含目前控制項的最上層控制項。The Control that represents the top-level control that contains the current control.

屬性

備註

最上層控制項定義為不是另一個 Windows Forms 控制項父系的父控制項。The top-level control is defined as the parent control that is not parented by another Windows Forms control. 通常,這會是內含控制項最外層的 FormTypically, this is the outermost Form that the control is contained in. 例如,如果控制項包含在 MDI 子 Form上,則最上層控制項就是多重文件介面(MDI)父 FormFor example, if the control is contained on an MDI child Form, then the top-level control is the Multiple Document Interface (MDI) parent Form. 如果控制項不是 Form的父系,這個屬性將會傳回 nullIf the control is not parented on a Form, this property will return null.

適用於

另請參閱