Menu.MenuItemCollection.Find(String, Boolean) Menu.MenuItemCollection.Find(String, Boolean) Menu.MenuItemCollection.Find(String, Boolean) Menu.MenuItemCollection.Find(String, Boolean) Method

Definition

Finds the items with the specified key, optionally searching the submenu items

public:
 cli::array <System::Windows::Forms::MenuItem ^> ^ Find(System::String ^ key, bool searchAllChildren);
public System.Windows.Forms.MenuItem[] Find (string key, bool searchAllChildren);
member this.Find : string * bool -> System.Windows.Forms.MenuItem[]
Public Function Find (key As String, searchAllChildren As Boolean) As MenuItem()

Parameters

key
String String String String

The name of the menu item to search for.

searchAllChildren
Boolean Boolean Boolean Boolean

true to search child menu items; otherwise, false.

Returns

An array of MenuItem objects whose Name property matches the specified key.

Exceptions

Remarks

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.

Applies to