# parentid

> [HTML Version](parentid_aui_control.htm)

_Updated July 2025_

If _parentid_ (Integer) is specified when creating a new control, the new control becomes a child of the specified control. This has two primary ramifications: 1) the coordinates of the child control are taken to be relative to the client area of the parent, and 2) such child controls will be automatically deleted when the parent is deleted or cleared.

If parentid is not specified (or is zero), it defaults to the current modal dialog (if any), provided that the [MBF2\_NOAUTOPARENT](ctype2.md#mbf2_noautoparent) flag is not specified.

_Parentid_, like _ctlid_, may also be expressed as an alphanumeric string.

Dialogs created with AUI\_CONTROL may specify a parent ID of -1 to signify that the dialog is a child of the main window. The default (0) makes the new dialog a child of the current dialog, if any.

**See Also**

•	[ctlid](ctlid.md)

•	[Control names](controlnames.md)

•	[MBF2\_NOAUTOPARENT](ctype2.md#mbf2_noautoparent)