Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

windows form textbox only allow numbers

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
        e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar);
    }
 
PREVIOUS NEXT
Tagged: #windows #form #textbox #numbers
ADD COMMENT
Topic
Name
5+5 =