标签:for ar type text date select value c
private void InputClear(Control EditArea)
{
foreach (Control Ctrl in EditArea.Controls)
{
if (Ctrl.GetType().Equals(typeof(TextBox)))
{
Ctrl.Text = "";
}
if (Ctrl.GetType().Equals(typeof(ComboBox)))
{
ComboBox cmb = (ComboBox)Ctrl;
cmb.SelectedIndex = 0;
}
if (Ctrl.GetType().Equals(typeof(DateTimePicker)))
{
DateTimePicker dtp = (DateTimePicker)Ctrl;
dtp.Value = DateTime.Now;
}
}
}
根据需要把所有可能用到的控件添加进去
标签:for ar type text date select value c
原文地址:http://www.cnblogs.com/Kevin1002/p/3879943.html