Menu.MenuItemCollection.Find(String, Boolean) 方法

定義

尋找具有指定索引鍵的項目,並選擇性地搜尋子功能表項目。

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

要搜尋的功能表項目名稱。

searchAllChildren
Boolean

true 表示要搜尋子功能表項目,否則為 false

傳回

MenuItem 物件的陣列,其 Name 屬性符合指定的 key

例外狀況

keynull 或空字串。

備註

索引鍵比較不區分大小寫。 key如果 參數為 null 或空字串,或沒有相符專案,則 Find 傳回空陣列。

屬性 Name 會對應至 中的 索引 Menu.MenuItemCollectionMenuItem

適用於