日期:2014-05-18 浏览次数:20960 次
private void ClearEdit(Control.ControlCollection AControls) { foreach (Control vControl in AControls) { if (vControl is TextBox) { ((TextBox)vControl).Text = string.Empty; } else if (vControl is ComboBox) { ((ComboBox)vControl).Text = string.Empty; } else ClearEdit(vControl.Controls); } } private void button1_Click(object sender, EventArgs e) { ClearEdit(Controls); }