Cleaning mask of characters

Asked

Viewed 98 times

0

I created my mask, only when I cancel it gets your characters in it. for example: if I put 0000000000, no time to save gets that number on the mask. Give 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";
    }
}

inserir a descrição da imagem aqui

  • Young man, you can’t understand what you want. Try [Dit] your question and detail it better.

  • 2

    Dude, this is very confusing, please detail us what is your problem,when the problem occurs, what is the expected outcome... Can’t tell if you want to clean the mask or you want to clean the field, if you want to save or if you want to cancel, it’s hard...

1 answer

1

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

Something like:

      mtbCPF.Clear

Browser other questions tagged

You are not signed in. Login or sign up in order to post.