Control.ControlCollection.Find Method (String, Boolean)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Searches for controls by their Name property and builds an array of all the controls that match.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public Control[] Find(
	string key,
	bool searchAllChildren
)

Parameters

key
Type: System.String

The key to locate in the Control.ControlCollection.

searchAllChildren
Type: System.Boolean

true to search all child controls; otherwise, false.

Return Value

Type: System.Windows.Forms.Control[]

An array of type Control containing the matching controls.

Exception Condition
ArgumentException

The key parameter is null or the empty string ("").

.NET Framework
Available since 2.0
Return to top
Show: