samedi 1 août 2015

C# Verify that 2 textboxes contain text

What I am trying to do is make a button disabled when the text boxes have no text in them and when text does occupy the desired textboxes the button becomes enabled

if (NamePath.Text.Length == 0 && ThemePath.Text.Length == 0)
{
    button1.Enabled = false;
}
else if (NamePath.Text.Length > 0 && ThemePath.Text.Length > 0)
{
     button1.Enabled = true;
     label7.Text = "Press Button To Find a Match";
     label7.ForeColor = Color.PaleGreen;
}

Aucun commentaire:

Enregistrer un commentaire