private void txtNumeric_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if (!System.Char.IsNumber(e.KeyChar) && e.KeyChar != (char)System.Windows.Forms.Keys.Back) { e.Handled = true; } }I appologize that the code is C#, but it should be very easy to convert