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 或空字符串(“)。

适用于