Clearing character masks [closed]

0

I created my mascara, but when I go to cancel it gets its characters in it. for example: your I put 0000000000, not time to save gets that number in the mask. Take a look at the image

My clean code is this:

mtbCPF.Mask = "";

My event:

private void mtbCPF_KeyPress(object sender, KeyPressEventArgs e)
{
    if (mtbCPF.Mask != null)
    {
        mtbCPF.Mask = "000,000,000-00";
    }
}

    
asked by anonymous 03.05.2016 / 21:11

1 answer

1

Every MakedTextbox field will always show the mask defined. What you have to do is clear the mask code using CLEAR.

Something like:

      mtbCPF.Clear
    
04.05.2016 / 01:08