Control.ControlCollection.Find(String, Boolean) 方法

定義

根據 Name 屬性搜尋控制項,並建置所有相符之控制項的陣列。

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

參數

key
String

要在 Control.ControlCollection 中尋找的索引鍵。

searchAllChildren
Boolean

true 表示要搜尋所有子控制項,否則為 false

傳回

Control[]

Control 型別的陣列,其中包含相符的控制項。

例外狀況

keynull 或空字串 ("")。

適用於