示例#1
0
        public void clear(String skip)
        {
            foreach (Control ctl in this.ctl)
            {
                if (ctl.GetType() == typeof(TextBox) || ctl.GetType() == typeof(RichTextBox))
                {
                    if (ctl.Name == skip)
                    {
                        continue;
                    }
                    ctl.Text = "";
                }

                if (ctl.GetType() == typeof(ComboBox))
                {
                    ((ComboBox)ctl).Text = "";
                }
                if (ctl.GetType() == typeof(NumericUpDown))
                {
                    ((NumericUpDown)ctl).Value = 1;
                }
                if (ctl.GetType() == typeof(DateTimePicker))
                {
                    ((DateTimePicker)ctl).Value = DateTime.Now;
                }
            }
        }