Hi sianan,
You could handle the keypress event and just allow numeric values. You
might also want to allow the delete key. Something like this:
void textBox1_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
const char Delete = (char)8;
e.Handled = !char.IsDigit(e.KeyChar) && e.KeyChar != Delete;
}
Hope that helps,
John
sianan wrote:
I am looking for a regular expression to validate input into a textbox.
I only want to allow valid alpha-numeric characters (no special
characters, such as ?, *, {} [] etc...).
An example would be much-appreciated!
Thanks!