ToolStripItemCollection.Find(String, Boolean) 方法

定義

根據名稱搜尋項目,並傳回所有相符控制項的陣列。Searches for items by their name and returns an array of all matching controls.

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

參數

key
String

要在 ToolStripItemCollection 中搜尋的項目名稱。The item name to search the ToolStripItemCollection for.

searchAllChildren
Boolean

true 表示搜尋 key 參數指定之 ToolStripItem 的子項目,否則為 falsetrue to search child items of the ToolStripItem specified by the key parameter; otherwise, false.

傳回

ToolStripItem[]

搜尋結果的 ToolStripItem 陣列。A ToolStripItem array of the search results.

例外狀況

key 參數是 null 或空白。The key parameter is null or empty.

適用於