Control.TopLevelControl Control.TopLevelControl Control.TopLevelControl Control.TopLevelControl Property

定義

取得沒有其他 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,表示包含目前控制項的最上層控制項。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父代, 則這個屬性null會傳回。If the control is not parented on a Form, this property will return null.

安全性

UIPermission
適用于所有視窗以取得此屬性值。for all windows to get this property value. 相關聯的列舉:AllWindowsAssociated enumeration: AllWindows

適用於

另請參閱