private void groupListView_DoubleClick(object sender, EventArgs e) { // get the selected group name string groupName = groupListView.SelectedItems[0].Text; // set up the selected ContactGroup group ContactGroup contactGroup = null; foreach (ContactGroup group in GroupList) { if (group.Name.Equals(groupName)) { contactGroup = group; break; } } // open a CreateGroupForm CreateGroupForm groupForm = new CreateGroupForm(contactGroup); groupForm.ShowDialog(); }
private void createGroupButton_Click(object sender, EventArgs e) { CreateGroupForm groupForm = new CreateGroupForm(null); groupForm.ShowDialog(); }