Difference between revisions of "DesktopUIControl.Parent"

From Xojo Documentation

(Notes)
(Notes)
 
Line 12: Line 12:
  
 
== Notes ==
 
== Notes ==
If the control is on the window, the Parent will be the [[DesktopWindow|Window]]. If the control is completed enclosed by another control, the Parent will be that [[DesktopUIControl|control]].
+
If the control is on the window, the Parent will be the [[DesktopWindow|Window]]. If the control is on the container, the Parent will be the [[DesktopContainer|container]]. If the control is completed enclosed by another control, the Parent will be that [[DesktopUIControl|control]].
  
 
If you do not want the enclosing control to be the parent, set the Parent property of that control to [[Nil]] to make it the [[DesktopWindow|Window]].
 
If you do not want the enclosing control to be the parent, set the Parent property of that control to [[Nil]] to make it the [[DesktopWindow|Window]].

Latest revision as of 02:54, 24 November 2021

Property (As Object )
aDesktopUIControl.Parent = newObjectValue
or
ObjectValue = aDesktopUIControl.Parent

New in 2021r3

Supported for all project types and targets.

Used to get and set the control’s parent control or window.

Notes

If the control is on the window, the Parent will be the Window. If the control is on the container, the Parent will be the container. If the control is completed enclosed by another control, the Parent will be that control.

If you do not want the enclosing control to be the parent, set the Parent property of that control to Nil to make it the Window.

If the parent control is somehow in another window, an InvalidParentException will occur.

Example

The following example sets the parent of the control to the window.

Me.Parent = Nil