ToolStripItemCollection.Find(String, Boolean) ToolStripItemCollection.Find(String, Boolean) ToolStripItemCollection.Find(String, Boolean) ToolStripItemCollection.Find(String, Boolean) Method

定义

根据项名称搜索项,并返回所有匹配控件的数组。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 String String String

要在 ToolStripItemCollection 中搜索的项的名称。The item name to search the ToolStripItemCollection for.

searchAllChildren
Boolean Boolean Boolean Boolean

若要搜索由 key 参数指定的 ToolStripItem 的子项,则为 true;否则为 falsetrue to search child items of the ToolStripItem specified by the key parameter; otherwise, false.

返回

搜索结果的 ToolStripItem 数组。A ToolStripItem array of the search results.

异常

key 参数为 null 或为空。The key parameter is null or empty.

适用于