forum

home / developersection / forums / clear checkboxes and textboxes in splitcontainer - c#

Clear Checkboxes and Textboxes in Splitcontainer - C#

Anonymous User 4553 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?


c# c# 
Updated on 23-Dec-2013

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By