Sunday 10 May 2015

Loop throuth all textboxes in Winforms

For iterating through all textboxes in winforms:

foreach (TextBox TextBox in this.Controls.OfType<TextBox>())
            {
                if (TextBox.BackColor == Brushes.Green)
                {
                    //your code
                }
            }

No comments:

Post a Comment