Shovan Saha

Shovan Saha

  • NA
  • 321
  • 91.9k

text box two decimal value

Aug 18 2017 2:45 PM
C# visual studio 2015. I have a text box. I do not want to write more than two decimal value. I have tried like this:
private void txtAPenPension_TextChanged(object sender, EventArgs e)
{
if (System.Text.RegularExpressions.Regex.IsMatch(txtAPenPension.Text, " ^ [0-9]"))
{
txtAPenPension.Text = "";
}

Answers (3)