ToolStripItemCollection.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 items by their name and returns an array of all matching controls.

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

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

Parameters

key
Type: System.String

The item name to search the ToolStripItemCollection for.

searchAllChildren
Type: System.Boolean

true to search child items of the ToolStripItem specified by the key parameter; otherwise, false.

Return Value

Type: System.Windows.Forms.ToolStripItem[]

A ToolStripItem array of the search results.

Exception Condition
ArgumentNullException

The key parameter is null or empty.

.NET Framework
Available since 2.0
Return to top
Show: