SyntaxFix
Write A Post
Hire A Developer
Questions
use this code:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { const char Delete = (char)8; e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete; }