TextBox
NumericUpDown
private void MyTextBox_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = !char.IsDigit(e.KeyChar); }
private void tbxHeightBackImage_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)