示例#1
0
        private void bttnNew_Click(object sender, System.EventArgs e)
        {
            FORMCategory_Modify.ADD_STATE = true;
            FORMCategory_Modify sForm = new FORMCategory_Modify();

            sForm.ShowDialog();
        }
示例#2
0
 private void bttnEdit_Click(object sender, System.EventArgs e)
 {
     if (listView1.Items.Count > 0)
     {
         try
         {
             FORMCategory_Modify.ADD_STATE = false;
             FORMCategory_Modify.sCategory = listView1.Items[listView1.FocusedItem.Index].SubItems[0].Text;
             FORMCategory_Modify sForm = new FORMCategory_Modify();
             sForm.ShowDialog();
         }
         catch (ArgumentOutOfRangeException aooreE) { MessageBox.Show("" + aooreE.Message); }
         catch (NullReferenceException nreE) {}
     }
     else
     {
         MessageBox.Show("No record to edit.", "Unable to Edit", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }