Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionprivate void buttonAdd_Click(object sender, EventArgs e) { string boxTitle; string boxDescription; DateTime boxDate; boxTitle = textBoxTitle.Text; boxDescription = richTextBoxDescAdd.Text; boxDate = dateTimePicker.Value; if (nbRDV < 1000) { RDVs[nbRDV] = new RDV(boxTitle, boxDescription, boxDate.Date); labelNb.Text = nbRDV.ToString(); } listBoxDel.Items.Add(boxDate.Date + " " + boxTitle + " " + boxDescription); nbRDV++; StreamWriter SW = new StreamWriter("toto.txt"); for (int i = 0; i < nbRDV; i++) { SW.WriteLine(RDVs[i].MyToString()); } SW.Close(); MessageBox.Show("Entrée bien ajoutée !"); textBoxTitle.Clear(); richTextBoxDescAdd.Clear(); }