private void Button1_Click(object sender, EventArgs e) { try { UjPenznemForm dialogus = new UjPenznemForm(); if (dialogus.ShowDialog() == DialogResult.OK) { ListBoxRefresh(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Button2_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { try { UjPenznemForm dialogus = new UjPenznemForm((Penznem)listBox1.SelectedItem, true); dialogus.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("To display a currency choose one!", "Attention!", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void Button3_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { try { UjPenznemForm dialogus = new UjPenznemForm((Penznem)listBox1.SelectedItem); if (dialogus.ShowDialog() == DialogResult.OK) { ListBoxRefresh(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("To modify a currency choose one!", "Attention!", MessageBoxButtons.OK, MessageBoxIcon.Information); } }