In your validation code(KeyPress or KeyDown), do the following:
That chesk for digits(0-9) and control keys(arrows, delete, etc). Hope that helps!Code:private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if ((Char.IsDigit(e.KeyChar) == false) && (Char.IsControl(e.KeyChar) == false)) { e.Handled = true; } }




Reply With Quote