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
How to avoid more than One Dot(.) symbol in textbox?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Aug 4, 2011, 2:45 AM EDT
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '.' && textBox1.Text.Contains("."))
{
e.Handled = true;
}
}