Monday, February 28, 2005

C#: only specific characters to be typed into a TextBox

private void TextBox1_KeyPress(object sender, ystem.Windows.Forms.KeyPressEventArgs e)
{
e.Handled = e.KeyChar < '0' e.KeyChar > '9';
}

No comments: