Control.Parent Property

 

Gets or sets the parent container of the control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<BrowsableAttribute(false)>]
member Parent : Control with get, set

Property Value

Type: System.Windows.Forms.Control

A Control that represents the parent or container control of the control.

Setting the Parent property value to null removes the control from the Control.ControlCollection of its current parent control.

The following code example uses the Parent property and the FindForm method to set properties on the parent control of a button and its form.

No code example is currently available or this language may not be supported.

UIPermission

for all windows to get this property value. Associated enumeration: UIPermissionWindow.AllWindows

.NET Framework
Available since 1.1
Return to top
Show: