語言

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 陣列。

例外狀況

keynull 空字串(“”)。

適用於