Export (0) Print
Expand All
Expand Minimize

Control.TopLevelControl Property

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

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

'Declaration
Public ReadOnly Property TopLevelControl As Control
'Usage
Dim instance As Control
Dim value As Control

value = instance.TopLevelControl

/** @property */
public Control get_TopLevelControl ()

public function get TopLevelControl () : Control

Not applicable.

Property Value

The Control that represents the top-level control that contains the current control.

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft