// on selecting item from combo-dropdown
        private void comboBox_accounts_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = comboBox_accounts.SelectedIndex;                 // selected account

            label_balance.Text  = accounts[index].Balance.ToString("c"); // update current balance
            textBox_amount.Text = "";                                    // clear the amount
            // update relevant info
            if (accounts[index].GetType().Name == "SavingsAccount")
            {
                label_overdraft_minBalance.Text = "Min Balance: ";
                label_overdraft_minBalance.Tag  = "Min Balance";
                SavingsAccount s = (SavingsAccount)accounts[index];
                label_odl_minB.Text = s.MinimumBalance.ToString("c");
            }
            else
            {
                label_overdraft_minBalance.Text = "Overdraft Limit: ";
                label_overdraft_minBalance.Tag  = "OverdraftLimit";
                CheckingAccount c = (CheckingAccount)accounts[index];
                label_odl_minB.Text = c.OverdraftLimit.ToString("c");
            }
        }
 private void button_addMonthlyInterest_Click(object sender, EventArgs e)
 {
     // add monthly interest in all accounts
     foreach (BasicAccount account in accounts)
     {
         if (account.GetType().Name == "SavingsAccount")
         {
             SavingsAccount s = (SavingsAccount)account;
             s.AddMonthlyInterest();
             account.Balance = s.Balance; // update balance
         }
         else
         {
             CheckingAccount c = (CheckingAccount)account;
             c.AddMonthlyInterest();
             account.Balance = c.Balance;
         }
     }
     UpdateList(); // udpate list
     comboBox_accounts.Text = "Account#";
     label_odl_minB.Text    = "";
     label_balance.Text     = ""; // clear current balance
     textBox_amount.Text    = ""; // clear the amount
 }