Menu.MenuItemCollection.Find(String, Boolean) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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()
- key
- String
The name of the menu item to search for.
- searchAllChildren
- Boolean
true
to search child menu items; otherwise, false
.
An array of MenuItem objects whose Name property matches the specified key
.
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.
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, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: