private void btnAdd_Click(object sender, EventArgs e) { string description = txbAdd.Text; string priority = txbPriority.Text; DateTime date = dtpDate.Value; txbAdd.Clear(); txbPriority.Clear(); ToDo A1 = new ToDo(description, date, priority); ListUtil.toDoList.Add(A1); TextFileUtil.writeToFile(A1); lstbxDo.Items.Add(A1.ToString()); // TextFileUtil.writeToFile(ListUtil.toDoList); //lstbxDo.Items.Add(txbAdd.Text); //lstbxDo.Items.Add(txbPriority.Text); //lstbxDo.Items.Add(dtpDate.Value); //MessageBox.Show(A1.Description+A1.Date+A1.Priority.ToString()); }
public Form1() { InitializeComponent(); TextFileUtil.writeToFile(ListUtil.toDoList); ListUtil.toDoList = TextFileUtil.readFromFile(); //Picture on form taken from //Author:Marco Verch //https://ccnull.de/foto/hands-holding-clipboard-with-to-do-list/1020658 }