Beispiel #1
0
        private void editContactButton_Click(object sender, EventArgs e)
        {
            int mainIndex = contactListBox.SelectedIndex;

            if (mainIndex == -1)
            {
                MessageBox.Show("No contacts selected.");//show message to tell user nothing is selected
                return;//returning early so that it does not try to delete nothing
            }

            Contact toEdit = virtualContactList[mainIndex];
            EditExistingContactWindow form = new EditExistingContactWindow(toEdit);

            form.ShowDialog();

            refreshListBox();
        }
Beispiel #2
0
 //(EDIT THIS CONTACT BUTTON) opens the contact editor (make later)
 private void button1_Click(object sender, EventArgs e)
 {
     EditExistingContactWindow form = new EditExistingContactWindow(contactToView);
     form.ShowDialog();
     Close();
 }