Try the following:
private void TextBox1_Validating(object sender, EventArgs e)
{
string expression = "^\d{1,8}(\.\d{2,2})?$";
if (System.Text.RegularExpressions.Regex.Match(this.txt_monto_total.Text, expression).Success)
this.label_total.Visible = false;
else
this.label_total.Visible = true;
}
This is not a mask, but it will allow you to tell the user if they entered the wrong format (I do this by showing the label), you can use any regular expression, in my case I want only numbers from 1 or 8 digits to "." and 2 after him.
source
share