private void Btn_Graph_Click(object sender, EventArgs e) { //Génération des points Liste = new List <Mon_Point>(); Random Rnd = new Random(); //Pour avoir de l'aléatoire int x = 0, y = 0; Nb = Rnd.Next(10, 26); // Génère un aléatoire entre [10;26[ for (int i = 0; i < Nb; i++) //Liste de points { x = x + Rnd.Next(5, 21); y = Rnd.Next(1, 202); if (y < 101) { y = -y; } else { if (y == 101) { y = 0; } else { y -= 101; } } Liste.Add(new Mon_Point(x, y)); } Dessiner(); Pnl_Point.Invalidate(); }
private void Pnl_Point_Resize(object sender, EventArgs e) { if (Liste != null) { Dessiner(); } Pnl_Point.Invalidate(); }
private void Btn_Fond_Click(object sender, EventArgs e) { Dlg_Couleur.Color = Fond; if (Dlg_Couleur.ShowDialog() == DialogResult.OK) { Fond = Dlg_Couleur.Color; Pnl_Point.Invalidate(); } }