private void Form1_Load(object sender, EventArgs e) { string t; int cpt = 0; this.labEncouragement.Text = string.Empty; this.labEncouragement2.Text = string.Empty; for (int j = 0; j < 4; j++) { // Création des LABEL de la grille for (int i = 0; i < 4; i++) { cpt++; int pas = 60; LAbelXY l = new LAbelXY(); { l.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, FontStyle.Bold, GraphicsUnit.Point, (byte)0); l.Parent = this; } l.Click += new EventHandler(this.LetterIsChoosen); t = cpt.ToString(); l.Text = t; l.Name = t; l.Width = pas - 20; l.Height = pas - 20; l.Top = 20 + (j * pas); l.Left = 20 + (i * pas); l.ForeColor = this.defaultColor; l.X = i; l.Y = j; l.Show(); } } DataGame.ResetWordScore(); DataGame.RazScoreTotal(); // Pour la contruction d'un arbre des lettres à partir de la liste des mots français LoadWordsDictionnary.InitialiseEnvironnement(); if (LoadWordsDictionnary.GetAuthorizationStatus()) { DonneesLettres.MatrixIniialization(); this.NewGame(); } else { _ = MessageBox.Show( "Erreur à l'ouverture du dictionnaire des mots Français\r\n" + " Verifiez si le fichier MOTS TRADUITS.txt est présent sous le même répertoire que celui\r\n" + " de l'application.", "Erreur fatale.", buttons: MessageBoxButtons.OK, MessageBoxIcon.Stop); Application.Exit(); } this.PossibleWordsInTextbox2(); }
/// <summary> /// Definit le raitement quand une lettre est choisie. /// </summary> private void LetterIsChoosen(object sender, EventArgs e) { this.ImageGai.Visible = false; this.ImageTriste.Visible = false; this.labEncouragement.Text = string.Empty; this.labEncouragement2.Text = string.Empty; LAbelXY choisi = sender as LAbelXY; { choisi.Visible = false; choisi.Visible = false; this.GereClicSurLettre(choisi.Name.ToString(), choisi.Y, choisi.X); } }