Bonjour à tous,

Je développe une application pour mon examen de fin de 1ère année. Le fonctionnement se base sur un formulaire MDI qui charge des formulaires enfants etc... la partie sur laquelle je bloque est la suivante:

Il y a une boite de login simple avec 3 boutons, suivant sur lequel on clique, ouvre une session Enseignant, élève ou simplement annuler qui donnera un environnement vide. Chaque bouton est lié a un évènement click dans lequel je charge une méthode se trouvant dans un autre formulaire. Mais rien ne se passe...

Voici les méthodes concernées:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
                /*Controles qui seront désactivés selon la session choisie ou s'il y a annulation*/
                public void SessionEnseignant_DesactivationControles()
                {
                    #region VISIBLE
                    //Menu Fichier
                    this.mnuConnexion.Visible = false;
                    //Menu Fenêtre
                    this.mnuQuestionnaire.Visible = false;
                    //Barre d'outils
                    this.tsbConnexion.Visible = false;
                    this.tsbQuestionnaire.Visible = false;
                    #endregion
                }
                public void SessionEleve_DesactivationControles()
                {
                    #region VISIBLE
                    //Menu Fichier
                    this.mnuConnexion.Visible = false;
                    //Menu Fenêtre
                    this.mnuReponses.Visible = false;
                    this.mnuEvaluation.Visible = false;
                    //Barre d'outils
                    this.tsbConnexion.Visible = false;
                    this.tsbReponses.Visible = false;
                    this.tsbEvaluation.Visible = false;
                    #endregion
                }
                public void SessionAnnuler_DesactivationControles()
                {
                    #region VISIBLE
                    //Menu Fichier
                    this.mnuDeconnexion.Visible = false;
                    //Menu Fenêtre
                    this.mnuQuestionnaire.Visible = false;
                    this.mnuReponses.Visible = false;
                    this.mnuEvaluation.Visible = false;
                    //Barre d'outils
                    this.tsbDeconnexion.Visible = false;
                    this.tsbQuestionnaire.Visible = false;
                    this.tsbReponses.Visible = false;
                    this.tsbEvaluation.Visible = false;
                    #endregion
                }
ces méthodes se trouvent dans
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
public partial class frmIDEC : Form
{
 
}
Voici le code de mon formulaire de login. Il est a noté que la boite s'affiche en ShowDialog():
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
namespace T1_UIL_IDEC
{
    public partial class frmSession : Form
    {
        //Champs
        private frmIDEC IDEC = null;
 
        public frmSession()
        {
            InitializeComponent();
            this.IDEC = new frmIDEC();
        }
 
        private void btnSessionEnseignant_Click(object sender, EventArgs e)
        {
            this.IDEC.SessionEnseignant_DesactivationControles();
        }
 
        private void btnSessionEleve_Click(object sender, EventArgs e)
        {
            this.IDEC.SessionEleve_DesactivationControles();
        }
 
        private void btnSessionAnnuler_Click(object sender, EventArgs e)
        {
            this.IDEC.SessionAnnuler_DesactivationControles();
        }
    }
}
Ce que je ne comprend pas, c'est pourquoi les évènements ne s'exécutent pas...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
 
namespace T1_UIL_IDEC
{
    public partial class frmIDEC : Form
    {
        #region CHAMPS
        /*Champs d'instance des formulaires*/
        private frmQuestionnaire Questionnaire = null;
        private frmReponses Reponses = null;
        private frmEvaluation Evaluation = null;
        private frmSession Session = null;
 
        #endregion
        #region CONSTRUCTEUR
            public frmIDEC()
            {
                InitializeComponent();
 
                this.Questionnaire = new frmQuestionnaire();
                this.Reponses = new frmReponses();
                this.Evaluation = new frmEvaluation();
            }
        #endregion
        #region METHODES
            #region REDIMENSIONNEMENT
                private void Redim_Questionnaire()
                {
                    //HAUTEUR
                    this.Questionnaire.Height = this.ClientSize.Height -
                                               (this.mnuPrincipal.Height +
                                                this.tspHaut.Height) - 5;
                    //LARGEUR
                    this.Questionnaire.Width = this.ClientSize.Width - 5;
                }
                private void Redim_Reponses()
                {
                    //HAUTEUR
                    this.Reponses.Height = this.ClientSize.Height -
                                          (this.mnuPrincipal.Height +
                                           this.tspHaut.Height) - 5;
                    //LARGEUR
                    this.Reponses.Width = this.ClientSize.Width - 5;
                }
                private void Redim_Evaluation()
                {
                    //HAUTEUR
                    this.Evaluation.Height = this.ClientSize.Height -
                                            (this.mnuPrincipal.Height +
                                             this.tspHaut.Height) - 5;
                    //LARGEUR
                    this.Evaluation.Width = this.ClientSize.Width - 5;
                }
            #endregion
            #region AFFICHAGE
                private void Affichage_Questionnaire()
                {
                    this.Questionnaire.MdiParent = this;
                    this.Questionnaire.Location = new Point(0, 0);
                    this.Questionnaire.Show();
                }
                private void Affichage_Reponses()
                {
                    this.Reponses.MdiParent = this;
                    this.Reponses.Location = new Point(0, 0);
                    this.Reponses.Show();
                }
                private void Affichage_Evaluation()
                {
                    this.Evaluation.MdiParent = this;
                    this.Evaluation.Location = new Point(0, 0);
                    this.Evaluation.Show();
                }
                private void Affichage_Session()
                {
                    this.Session = new frmSession();
                    this.Session.ShowDialog();
                    this.Session.Dispose();
                }
            #endregion
            #region DESACTIVATION DES CONTROLES
                /*Controles qui seront désactivés selon la session choisie ou s'il y a annulation*/
                public void SessionEnseignant_DesactivationControles()
                {
                    #region VISIBLE
                    //Menu Fichier
                    this.mnuConnexion.Visible = false;
                    //Menu Fenêtre
                    this.mnuQuestionnaire.Visible = false;
                    //Barre d'outils
                    this.tsbConnexion.Visible = false;
                    this.tsbQuestionnaire.Visible = false;
                    #endregion                    
                }
                public void SessionEleve_DesactivationControles()
                {
                    #region VISIBLE
                    //Menu Fichier
                    this.mnuConnexion.Visible = false;
                    //Menu Fenêtre
                    this.mnuReponses.Visible = false;
                    this.mnuEvaluation.Visible = false;
                    //Barre d'outils
                    this.tsbConnexion.Visible = false;
                    this.tsbReponses.Visible = false;
                    this.tsbEvaluation.Visible = false;
                    #endregion
                }
                public void SessionAnnuler_DesactivationControles()
                {
                    #region VISIBLE
                    //Menu Fichier
                    this.mnuDeconnexion.Visible = false;
                    //Menu Fenêtre
                    this.mnuQuestionnaire.Visible = false;
                    this.mnuReponses.Visible = false;
                    this.mnuEvaluation.Visible = false;
                    //Barre d'outils
                    this.tsbDeconnexion.Visible = false;
                    this.tsbQuestionnaire.Visible = false;
                    this.tsbReponses.Visible = false;
                    this.tsbEvaluation.Visible = false;
                    #endregion                    
                }
            #endregion
 
        #endregion
 
 
        /* ################## */
        /* ### EVENEMENTS ### */
        /* ################## */
 
        /*Evenement générique déclenché au redimensionnement du formulaire MDI*/
        private void Formulaires_ClientSizeChanged(object sender, EventArgs e)
        {
            if(this.Questionnaire != null | this.Reponses != null | this.Evaluation != null)
            {
                this.Redim_Questionnaire();
                this.Redim_Reponses();
                this.Redim_Evaluation();
            }
        }
 
        private void frmIDEC_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (MessageBox.Show("Voulez-vous vraiment quitter l'application ?", "Certificat de programmation IDEC",
                        MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2)
                            == DialogResult.No)
                e.Cancel = true;    //annulation de la fermeture de l'application
        }
 
        private void mnuQuitter_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
        private void mnuQuestionnaire_Click(object sender, EventArgs e)
        {
            this.Affichage_Questionnaire();
        }
 
        private void mnuReponses_Click(object sender, EventArgs e)
        {
            this.Affichage_Reponses();
        }
 
        private void mnuEvaluation_Click(object sender, EventArgs e)
        {
            this.Affichage_Evaluation();
        }
 
        private void frmIDEC_Load(object sender, EventArgs e)
        {
            this.Affichage_Session();
        }
 
        private void mnuConnexion_Click(object sender, EventArgs e)
        {
            this.Affichage_Session();
        }
 
        private void tsbConnexion_Click(object sender, EventArgs e)
        {
            this.Affichage_Session();
        }
    }
}
et voici tout le code du formulaire MDI...


Est-ce que c'est que je suis passé a côté d'une erreur ? autre chose ?