/// <summary>
/// 清空所有的文本框
/// </summary>
private void ClearAllTextBox()
{
foreach (Control control in this.groupBox1.Controls)
{
if(control is TextBox)
{
((TextBox)control).Text = "";
}
}
}
if (control.GetType().ToString()=="System.Windows.Forms.TextBox")
private void ClearTextBoxAndComboBoxAndCheckBox()
{
foreach (Control c in this.Controls)
{
if (c.GetType().ToString().Contains("TextBox"))
{
((TextBox)c).Text = "";
}
if (c.GetType().ToString().Contains("ComboBox"))
{
((ComboBox)c).Text = "";
}
if (c.GetType().ToString().Contains("CheckBox"))
{
((CheckBox)c).Checked = false;
}
}
}