private void button1_Click(object sender, EventArgs e) { try { Met12 m = new Met12(); m.Delete(comboBox1.Items[comboBox1.SelectedIndex].ToString()); this.Close(); } catch { MessageBox.Show("Error"); } }
private void button1_Click(object sender, EventArgs e) { try { Met12 d = new Met12(); d.ADD(textBox1.Text, Convert.ToInt32(textBox2.Text), textBox3.Text); this.Close(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); } catch { MessageBox.Show("Error"); } }