How to validate a blank maskedtextbox?

0

In this case, the maskedtextboxTEL (00)0000-0000 would return a error provider and would only continue after completing it.

    
asked by anonymous 31.03.2016 / 22:45

1 answer

0

You can use método String.IsNullOrWhiteSpace .

Code

 if (String.IsNullOrWhiteSpace(txt_Telefone.Text))
 {
    errorProvider1.SetError(txt_Telefone, "Preencha o telefone ! ");
 }
    
01.04.2016 / 00:41