Label[10,6] mesLabels;//par exemple si tu as 10 colonnes et 6 lignes, et tes indices sont directement le X et le Y de ta grille
private void Horizontal_mot() { if (counter_horizontale > 39) { this.label2[counter_horizontale].Visible = false; counter_horizontale -= 39; a = 0; } if (counter_horizontale >= 19) { this.label2[counter_horizontale].Visible = false; counter_horizontale += 20; } if (counter_horizontale < 19 & a == 1) { this.label2[counter_horizontale].Visible = false; counter_horizontale += 20; } a = 1; }
private void timer1_Tick(object sender, EventArgs e) { this.label2[0].Visible = false; counter += 1; // counter_horizontale += 1; if (counter == 0) timer1.Stop(); label1.Text = counter.ToString() + "s"; if (counter < 61) { Horizontal_mot(); } else { } }
private void button7_Click(object sender, EventArgs e) { timer1 = new Timer(); timer1.Tick += new EventHandler(timer1_Tick); timer1.Interval = 250; // 0.25 second timer1.Start(); }