ToolStripItemCollection.Find(String, Boolean) Method

Definition

Searches for items by their name and returns an array of all matching controls.

C#
public System.Windows.Forms.ToolStripItem[] Find(string key, bool searchAllChildren);

Parameters

key
String

The item name to search the ToolStripItemCollection for.

searchAllChildren
Boolean

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

Returns

A ToolStripItem array of the search results.

Exceptions

The key parameter is null or empty.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9