foreach (Control ctrl in cc)
{
checkbox cb = ctrl as checkbox;
if (cb != null)
cb.Checked = false;
else
RecursiveClearTextBoxes(ctrl.Controls);
}
you can use
as
like above or you can use
is
like below
foreach (Control ctrl in cc)
{
if (cb is checkbox)
cb.Checked = false;
else
RecursiveClearTextBoxes(ctrl.Controls);
}