Timing! There is a very similar post here
Validation for a text box with alphanumeric[
^] which just came in!
Using the solution I just posted there you can try this
private void textBox1_Validating(object sender, CancelEventArgs e)
{
e.Cancel = !Regex.IsMatch(textBox1.Text, @"^\d+$");
}
{Edit - Validating event not required here as only numeric allowed and that will be forced by the KeyPress event below
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = !(Char.IsDigit(e.KeyChar) || e.KeyChar == '\b' || e.KeyChar == '.');
}