Users Pricing

forum

Home Forums Clear Checkboxes and Textboxes in Splitcontainer - C# – MindStick

Clear Checkboxes and Textboxes in Splitcontainer - C#

Anonymous User 4713 23 Dec 2013

I'm attempting to clear all the checkboxes and textboxes in the first panel of my splitcontainer but I'm having no luck as nothing seems to happen.

private void clearSettingsBtn_Click(object sender, EventArgs e)
{
    foreach (Control c in splitContainer1.Panel1.Controls)
    {
        if (c is CheckBox)
        {
            ((CheckBox)c).Checked = false;
        }
        else if (c is TextBox)
        {
            ((TextBox)c).Clear();
        }
    }
}

Have I missed something?


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md