private void ClearBtn_Click(object sender, EventArgs e) //Clears the current input(s) and output { //resets to default settings as when form loads InputBox.Text = "0"; OffPeakBox.Text = "0"; AcctBox.Text = ""; NameBox.Text = ""; DropDown.SelectedItem = "Residential"; AcctBox.Select(); ChargeBox.Text = ""; }
private void MainForm_Load(object sender, EventArgs e) //Default settings when form opens { //hide the Off-Peak label and input text box by default OffPeakBox.Visible = false; OffPeakLabel.Visible = false; //default values in textboxes InputBox.Text = "0"; OffPeakBox.Text = "0"; AcctBox.Text = ""; NameBox.Text = ""; //select Residential in combobox by default DropDown.SelectedItem = "Residential"; //focus on Account number box on start AcctBox.Select(); //read customer info from txt file and save it on the customer list then display it on listbox AllCustomers = Customer.ReadCustomers(); DisplayCustomers(); }