TreeNodeCollection.Find(String, Boolean) 方法

定義

尋找具有指定索引鍵的樹狀節點,選擇性搜尋子節點。

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

參數

key
String

要搜尋的樹狀節點名稱。

searchAllChildren
Boolean

若要搜尋樹狀節點的子節點則為 true,否則為 false

傳回

TreeNode 物件的陣列,其 Name 屬性符合指定的索引鍵。

例外狀況

.NET 5 和更新版本: keynull 或空白。

備註

屬性 Name 會對應至 中 之 的 TreeNodeTreeNodeCollection 索引鍵。

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

適用於