mercredi 20 mai 2015

if/else statment isn't working

I need your help once more. My if/else statment isn't working at all... I tried to do everything and look up at the code for the errors and didn't find quite errors, or maybe I couldn't see and there is errors on it.

I used in Home Form:

private string entrada;
public string entradas {
     get { return entrada; }
     set { entrada = value; }
}

I used this so I can pick the value from workgroup textbox that is at Form1.

Also in Home Form I put the following:

            if (entrada == "Marketing")
            {

                VEntradas f3 = new VEntradas();
                f3.nDoc.Visible = false;
                f3.button1.Visible = false;
                f3.label1.Text = "Não tens acesso há edição de entradas.";
            }
            else 
            {
                VEntradas f2 = new VEntradas();
                f2.nDoc.Visible = true;
                f2.button1.Visible = true;
                f2.nDoc.Enabled = true;
                f2.button1.Enabled = true;
                f2.label1.Text = "";
            } 

Even with this, the if/else statment isn't working and in "Marketing" value of workgroup textbox (Form1) it appears the buttons and shouldn't appear... Anyone can help me with it?

Aucun commentaire:

Enregistrer un commentaire