System.Windows.Forms.Control.TopLevelControl Property

Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost System.Windows.Forms.Form that the control is contained in.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
public Control TopLevelControl { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The top-level control is defined as the parent control that is not parented by another Windows Forms control. Typically, this is the outermost System.Windows.Forms.Form that the control is contained in. For example, if the control is contained on an MDI child System.Windows.Forms.Form, then the top-level control is the Multiple Document Interface (MDI) parent System.Windows.Forms.Form. If the control is not parented on a System.Windows.Forms.Form, this property will return null.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0