Tag Archives: find controls

Loop over a form’s controls in C#

This example shows how to loop over controls of various types on a form. The Control class defines a Controls property that is a collection containing references to the controls inside a control. For example, a form’s Controls collection holds … Continue reading

Posted in controls, forms | Tagged , , , , , , , , , , , , | 3 Comments

Find controls by name in C#

This example shows how you can search a control hierarchy to find controls by name in C#. The following FindControl function does all of the work. It takes as parameters the parent control to check first and the name to … Continue reading

Posted in controls | Tagged , , , , , , , , | 3 Comments