private void txtSpadRef_KeyPress(object sender, KeyPressEventArgs e)
{
Double isNumber = 0;
String s = e.KeyChar.ToString();
int[] allowedChar = new int[] {3,8,22,24 };
foreach (int i in allowedChar) {
if(e.KeyChar.Equals(Convert.ToChar(i))){
return;
}
}
if (s == "." && txtSpadRef.Text.IndexOf(".") < 0)
{
s += "0";
}
e.Handled = !Double.TryParse(s, out isNumber);
}
Malaya Merdeka - from Ash's vinyl collection
8 months ago
0 comments:
Post a Comment