I want textbox validation for allowing only one . value and only numbers. Means my textbox value should take only numerics and one . value. Value shoul
.
if(e.KeyChar.Equals('\b')) { e.Handled = false; } else if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && e.KeyChar != '.') { e.Handled = true; } else // only allow one decimal point if (e.KeyChar == '.' && textBox1.Text.IndexOf('.') > -1) { e.Handled = true; }