Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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);
        }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #windows #forms #iterate #controls
ADD COMMENT
Topic
Name
2+8 =