Control Relations
Table 3-2).
Table 3-2: Members for Control Relationships
Member
Description
HasChildren
Returns true if the Controls collection has at least one child control.
Controls
A special collection that allows you to add or examine child controls.
Parent
A reference to the parent control (the control that contains this control). This could be a form, or a container control like a group box. You can set this property to swap a control into a new container.
TopLevelControl and FindForm()
The TopLevelControl returns a reference to the control at the top of the hierarchy. Typically, this is the containing form. The FindForm() method is similar, but it returns null if the control is not situated on a form.
Contains()
This method accepts a control, and returns true if this control is a child of the current control.
GetChildAtPoint()
This method accepts a Point structure that corresponds to a location inside the current control. If a child control is located at this point, it is returned.
ContextMenu and Menu
These properties return the associated context menu (for a basic control) or menu object (for a form). Note that context menus must be explicitly displayed by your code before the user can interact with them, while pull-down menus appear automatically.