private void txtbox1_KeyPress(object sender, KeyPressEventArgs e)
{
//MessageBox.Show(Convert.ToInt32(e.KeyChar).ToString());
if (Convert.ToInt32(e.KeyChar) == 8)
return;
if (char.IsDigit(e.KeyChar) == false)
{
MessageBox.Show("Enter numerics only");
e.Handled = true;
}
}
Validation of textbox for entering only digits
This blog describe how to allow only digits in textbox


Dinkar ChavhanPosted Apr 19, 2011, 10:40 PM EDT
nice blog