private void addBtn_Click(object sender, EventArgs e) { ProductForm newProductForm = new ProductForm(); newProductForm.Focus(); newProductForm.Show(); }
private void productsLw_SelectedIndexChanged(object sender, EventArgs e) { try { Product product = Products.FindProduct(int.Parse(productsLw.SelectedItems[0].SubItems[0].Text)); if (product != null) { ProductForm productForm = new ProductForm(product); productForm.Focus(); productForm.Show(); } else { MessageBox.Show("Couldn't find the user, please try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception exception) { Console.WriteLine(exception); } }