public void Clear() { TB1A.Text = ""; TB2AHInicial.Text = ""; TB3AHFinal.Text = ""; CheckBox1.IsChecked = false; DatePicker.ClearValue(DatePicker.SelectedDateProperty); }
private void resetujBojuOkvira(object sender, EventArgs e) { try { TextBox t = (TextBox)sender; t.ClearValue(Border.BorderBrushProperty); } catch { DatePicker d = (DatePicker)sender; d.ClearValue(Border.BorderBrushProperty); } }
// static methods public static void ClearForm(List <Control> lst) { foreach (Control control in lst) { if (control is TextBox) { TextBox txtbox = (TextBox)control; txtbox.Clear(); } else if (control is PasswordBox) { PasswordBox passbox = (PasswordBox)control; passbox.Clear(); } else if (control is CheckBox) { CheckBox chkbox = (CheckBox)control; chkbox.IsChecked = false; } else if (control is RadioButton) { RadioButton rdbtn = (RadioButton)control; rdbtn.IsChecked = false; } else if (control is DatePicker) { DatePicker datePckr = (DatePicker)control; datePckr.ClearValue(DatePicker.SelectedDateProperty); } else if (control is ComboBox) { ComboBox cmbbox = (ComboBox)control; cmbbox.ClearValue(ComboBox.SelectedItemProperty); } } }