Answers for "C# loop through all controls in a form"

C#
1

windows forms iterate through all controls

private void LoopThroughControls(Control parent)
{
    foreach (Control c in parent.Controls)
    {
        if (c.GetType() == typeof(YourType)) {
            //Do stuff
        } else {
            LoopThroughControls(c);
        }
    }
}
Posted by: Guest on May-20-2020

Code answers related to "C# loop through all controls in a form"

C# Answers by Framework

Browse Popular Code Answers by Language