示例#1
0
        private void menuAdd_Click(object sender, EventArgs e)
        {
            FormAddEntry f = new FormAddEntry(this, FormAddEntry.FormRole.ROLE_ADD);

            f.Owner = this;
            f.Show();
            f.Focus();
        }
示例#2
0
 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);
         }
     }
 }