private void frmMain_Load_1(object sender, EventArgs e) { customerList = CustomerList.ReadCustomers(); // reads customer data from the list, if data exists DisplayCustomers(); // display the customer list data, if exists }
private void frmMain_FormClosed(object sender, FormClosedEventArgs e) { CustomerList.SaveCustomers(customerList); // save the data in the .txt file when form closes }