Menu::MenuItemCollection::Find Method (String^, Boolean)
.NET Framework (current version)
Finds the items with the specified key, optionally searching the submenu items
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- key
-
Type:
System::String^
The name of the menu item to search for.
- searchAllChildren
-
Type:
System::Boolean
true to search child menu items; otherwise, false.
Return Value
Type: array<System.Windows.Forms::MenuItem^>^An array of MenuItem objects whose Name property matches the specified key.
| Exception | Condition |
|---|---|
| ArgumentNullException | key is null or an empty string. |
The key comparison is not case-sensitive. If the key parameter is null or an empty string, or there are no matches, Find returns an empty array.
The Name property corresponds to the key for a MenuItem in the Menu::MenuItemCollection.
.NET Framework
Available since 2.0
Available since 2.0
Show: