Have a look at the below code
private void txtbox1_KeyPress(object sender, KeyPressEventArgs e)
{
const char Delete = (char)8;
e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete;
}
This will be helpful but users can Copy and Paste characters :-)