bonjour

j'ajoute des objets dans une liste mais si j'affiche la liste je vois que la liste contient des élément qui ont répété

mon code :

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
private void button1_Click(object sender, EventArgs e)
{
   employe.Nom = textBox1.Text;
   employe.Fonction = textBox2.text;
   employe.TypeEmployé = comboBox1.Text;
   employe.DateEmbauche = dateTimePicker2.Value;
   employe.DateNaissance = dateTimePicker1.Value;
 
    Employé.Liste.Add(employe);
 
   // afficher la liste dans une listBox :
 for (int i = 0; i < Employé.Liste.Count;i++)
 {
 
  listBox1.Items.Add("" + Employé.Liste[i].Nom + "" + Employé.Liste[i].TypeEmployé + "" + Employé.Liste[i].DateNaissance);
 
  }
}
par exemple : Si je tape :

aaaa 10/04/2013 Permanant

bbbb 10/04/2013 fonction

Affichage :

aaaa 10/04/2013 Permanant

bbbb 10/04/2013 fonction

bbbb 10/04/2013 fonction

aidez-moi s'il vous plait pour résoudre ce problème.