Spread Windows Forms 9.0 Product Documentation
Parent Property (ElementControl)
Example 


Gets or sets the parent of the control.
Syntax
'Declaration
 
Public Overridable Shadows Property Parent As Control
'Usage
 
Dim instance As ElementControl
Dim value As Control
 
instance.Parent = value
 
value = instance.Parent
public virtual new Control Parent {get; set;}

Property Value

Control object containing the parent of this control
Remarks

This property is available at run time only.

For more information, see the Parent property in the Microsoft .NET Framework Reference.

Example
// Change the parent of the controls
private void button1_Click(object sender, System.EventArgs e)
{
    control.Parent = groupBox1;
    control2.Parent = this; 
}
'Change the parent of the controls
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    control.Parent = Me
    control2.Parent = GroupBox1
End Sub
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

ElementControl Class
ElementControl Members

 

 


Copyright © GrapeCity, inc. All rights reserved.