System.Windows.Forms.Control.Controls Property

Gets the collection of controls contained within the control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)]
[System.ComponentModel.Browsable(false)]
public Control.ControlCollection Controls { get; }

Value

Documentation for this section has not yet been entered.

Remarks

A System.Windows.Forms.Control can act as a parent to a collection of controls. For example, when several controls are added to a System.Windows.Forms.Form, each of the controls is a member of the System.Windows.Forms.Control.ControlCollection assigned to the Control.Controls property of the form, which is derived from the System.Windows.Forms.Control class.

You can manipulate the controls in the System.Windows.Forms.Control.ControlCollection assigned to the Control.Controls property by using the methods available in the System.Windows.Forms.Control.ControlCollection class.

When adding several controls to a parent control, it is recommended that you call the Control.SuspendLayout method before initializing the controls to be added. After adding the controls to the parent control, call the Control.ResumeLayout method. Doing so will increase the performance of applications with many controls.

Use the Control.Controls property to iterate through all controls of a form, including nested controls. Use the Control.GetNextControl(Control, bool) method to retrieve the previous or next child control in the tab order. Use the ContainerControl.ActiveControl property to get or set the active control of a container control.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0