0
Guys, I know this site is very famous because the community is SUPER charitable and kind. Help me with this: I can’t get a Messagebox to show when I leave my Maskedtextbox blank. I formatted it to stay in the standard CPF 123.456.789-00 I’m making a registration form. I can do for normal Textbox, but for Maskedttextbox it doesn’t work. The code is like this:
if(txtNome.Text == "")
{
MessageBox.Show("Preencha o campo Nome!", "Falta de informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if(txtCpf.Text == "") // <- Essa é a MaskedTextBox
{
MessageBox.Show("Preencha o campo CPF!", "Falta de informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
the secret is how you ask the question... everything you typed there could be just "maskedtextbox is Empty", and then: https://stackoverflow.com/a/17757922/4713574
– Rovann Linhalis
Thank you so much, Rovann. You saved my night, man! God bless you :D
– Raul Cassita