示例#1
0
        private void ClearForm()
        {
            // clear all fields
            firstName.Clear();
            Minitial.Clear();
            lastName.Clear();
            Address1.Clear();
            Address2.Clear();
            City.Clear();
            State.SelectedItem = null;
            Zip.Clear();
            Gender.SelectedItem = null;;
            Phone.Clear();
            Email.Clear();
            Proof.SelectedItem = null;
            Date.Value         = DateTime.Today;

            // clear errors
            FieldError.SetError(firstName, "");
            FieldError.SetError(Minitial, "");
            FieldError.SetError(lastName, "");
            FieldError.SetError(Address1, "");
            FieldError.SetError(Address2, "");
            FieldError.SetError(City, "");
            FieldError.SetError(State, "");
            FieldError.SetError(Zip, "");
            FieldError.SetError(Gender, "");
            FieldError.SetError(Phone, "");
            FieldError.SetError(Email, "");
            FieldError.SetError(Proof, "");
            FieldError.SetError(Date, "");


            firstName.Select();
            SetAddMode();
        }