How to avoid more than One Dot(.) symbol in text box?
Because In my form (Windows application) all text box contains decimal values..
If I enter double dots . . it rise the error at the time of calculation..
In my form I've 12 text boxes
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 4, 2011, 6:45 AM
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '.' && textBox1.Text.Contains("."))
{
e.Handled = true;
}
}