private void menuAdd_Click(object sender, EventArgs e) { FormAddEntry f = new FormAddEntry(this, FormAddEntry.FormRole.ROLE_ADD); f.Owner = this; f.Show(); f.Focus(); }
private void CallEdit() { if (listContacts.SelectedItems.Count == 1) { try { int id = int.Parse(listContacts.SelectedItems[0].Text); FormAddEntry f = new FormAddEntry(this, FormAddEntry.FormRole.ROLE_EDIT, id); f.Owner = this; f.Show(); f.Focus(); } catch (Exception ex) { MessageBox.Show("Wystąpił błąd: " + ex.Message.ToString(), "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }