Modifier les caractéristiques d'un textbox d'une form1 a partir form2
Bonjour,
j'ai une form1 de saisie qui contient un textbox grisé,pour rendre ce champ non griser il faut passer a une autre form2 dans laquelle il faut saisir un login et mdp admin, si les paramètre sont correcte,fermer form2 et ré-afficher form1 mais avec un textbox non grisé
le code du bouton pour passer du form1 à form2
Code:
1 2 3 4
|
Form2 obj2 = new Form2();
this.Hide();
obj2.Show(); |
le code pour passer de form2 à form1
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
if (login.Text == "admin" && mdp.Text == "admin")
{
Form1 f1 = new Form1();
f1.Show();
f1.btn_modif_objectif.Visible = true;//afficher un bouton
f1.textBox11.ReadOnly = false;
f1.textBox22.ReadOnly = false;
f1.textBox33.ReadOnly = false;
f1.textBox44.ReadOnly = false;
f1.textBox55.ReadOnly = false;
f1.textBox66.ReadOnly = false;
f1.textBox77.ReadOnly = false;
f1.textBox88.ReadOnly = false;
}
else
lbl_msg.Text = "Login et/ou mot de passe incorrecte";
} |
merci d'avance.