private void mnuCategoriesAdd_Click(object sender, EventArgs e) { // show AddCategory form AddCategory fAddCategory = new AddCategory(); fAddCategory.ShowDialog(); }
// adding category private void cmdAdd_Click(object sender, EventArgs e) { AddCategory fAddCategory = new AddCategory(); //Initialized AddCategory form if (fAddCategory.ShowDialog() == DialogResult.OK) // show AddCategory form and if success { //get newly add category form AddCategory form and add to list newLstItem = lstCategories.Items.Add(String.Format("CAT{0:000}", fAddCategory.GetNewCategory().Id)); newLstItem.SubItems.Add(fAddCategory.GetNewCategory().Name); } }