Control::ControlCollection::Find Method (String^, Boolean)

 

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:
array<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: array<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: