Monday, May 17, 2010

Number only text box - C# Express Edition

private void txt_FieldName_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar < '0' || e.KeyChar > '9') && e.KeyChar != '\b')
e.KeyChar = '\0';
}

No comments: