Instead of changing my 15 textboxes manually, I would like to do it automatically, maybe doing a foreach loop? I don't know what do you call it but this kind of method is usually done when clearing textboxes and controls that is instead of putting a .clear() to all textbox, a method or a loop will be made and all of them would be cleared. How to do this? Sorry if this is somewhat confusing, for I am still a newbie.

1. You can create an array of all wanted textBoxes:

private void button1_Click(object sender, EventArgs e)
        {
            TextBox[] tb = new TextBox[] { textBox1, textBox2, textBox3, textBox4, textBox5 };
            for (int i = 0; i < tb.Length; i++)
                tb[i].Text = String.Empty;
        }

2. To loop through all controls, and if textBox is found, do something:

private void button2_Click(object sender, EventArgs e)
        {
            foreach (Control c in Controls)
            {
                if (c is TextBox)
                    c.Text = String.Empty;
            }
        }
This question has already been answered. Start a new discussion instead.