//фильтр ввода только цифр private void textBox_PreviewTextInput(object sender, TextCompositionEventArgs e) { char ch = e.Text[0]; if (InputFilter.CheckDigit(ch)) { e.Handled = true; } }