コード例 #1
0
 //Expenses sections //
 private void Clear_ExpBox_btn_Click(object sender, EventArgs e)
 {
     if (Expense_Combobox.Items.Count == 0)
     {
         MessageBox.Show("There is no values in box", "Expenses Box", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Expense_Combobox.Focus();
     }
     else
     {
         Expense_Combobox.Items.Clear();
         Expense_Count = 0;
         Count_ItemExpenses_Notfi.Text = Expense_Count.ToString();
     }
 }
コード例 #2
0
        private void EnterExpense_btn_Click(object sender, EventArgs e)
        {
            double ExpenseValue = 0;

            if (Expense_textBox.Text == string.Empty)
            {
                MessageBox.Show("Empty Revenue Box", "Empty detected", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Expense_textBox.Focus();
            }
            else if (double.TryParse(Expense_textBox.Text, out ExpenseValue))
            {
                Expense_Combobox.Items.Add(ExpenseValue);
                Expense_textBox.Text = String.Empty;
                Expense_Count++;
                Count_ItemExpenses_Notfi.Text = Expense_Count.ToString();
            }
            else
            {
                MessageBox.Show("Error Revenue Entry", "Error detected", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Expense_textBox.Focus();
                Expense_textBox.SelectAll();
            }
        }