Control.ControlCollection.Find(String, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
按控件 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 数组。
例外
key 是 null 或空字符串(“)。