Searching for a control in a Form

EFileTahi-A

Contributor
Joined
Aug 8, 2004
Messages
623
Location
Portugal / Barreiro
Is there a simple method to search for a specific control (by its name) in a form without loops? I need to access a Target control on the form to manipulate its properties, and since its name is a variable I need to find it and grab it. The result should be something like this:

Control cCtrl = this.GetControl("controlaName");
 
Last edited:
No! I won't tell you! It's mine! I found it first!

Code:
Control[] arrCtrls = this.Controls.Find("controlName", true);

The boolean value indicates wether should the search include child containers too. :D
 
Back
Top