private void LableEstChoisi(object sender, EventArgs e) { ImageGai.Visible = false; ImageTriste.Visible = false; LabelXY Choisi = (LabelXY)sender; // this.Text = Choisi.X.ToString() + ", " + Choisi.Y.ToString(); Choisi.Visible = false; GereClicSurLettre(Choisi.Name.ToString(), Choisi.Y, Choisi.X); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private void Form1_Load(object sender, EventArgs e) { string T; int cpt = 0; 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; // Label L = new System.Windows.Forms.Label(); LabelXY L = new LabelXY(); { L.Font = new System.Drawing.Font( "Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)) ); L.Parent = this; }; L.Click += new EventHandler(LableEstChoisi); 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 = CouleurDefaut; L.X = i; L.Y = j; L.Show(); } } m_gameScore.ResetWordScore(); m_gameScore.ResetTotalScore(); InitialiseEnvironnement(); // Pour la contruction d'un arbre des lettres à partir de la liste des mots français //DonneesLettres.InitDataPourGrille(); NouvelleDonne(); }