public int clearControls(Control typicalPanel) { foreach(Control ctr in typicalPanel.Controls ) { System.Type InstanceType = typicalPanel.GetType(); switch (InstanceType.Name) { case "RadioButton" : // here i can not access checked property ctr.Checked = false; break; case "CheckBox" : // here i can not access checked property ctr.Checked = false; break; case "TextBox": // here i can not access .text property ctr.Text =""; break; }
((TextBox)crt).Text = string.Empty;
((CheckBox)crt).Checked = false;
Control
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)