private void btn_group_Click(object sender, EventArgs e) { if (allowAction) { List<ContactDB> listCheckedContact = new List<ContactDB>(); int count = listview_contacts.Items.Count; ListViewItem item; for (int i = 0; i < count; i++) { item = listview_contacts.Items[i]; if (item.Checked) { int idx = (int)item.Tag; listCheckedContact.Add(listContact[idx]); } } BelongToGroupForm frm = new BelongToGroupForm(this, listCheckedContact); frm.ShowDialog(); } }
private void btn_group_Click(object sender, EventArgs e) { if (allowAction) { int count = listview_contacts.Items.Count; ListViewItem item; Object contactObj; List<Object> list = new List<Object>(); for (int i = 0; i < count; i++) { item = listview_contacts.Items[i]; if (item.Checked) { int idx = (int)item.Tag; contactObj = listDisplayContact[idx]; list.Add(contactObj); } } BelongToGroupForm frm = new BelongToGroupForm(this, list, listGroupName); frm.ShowDialog(); } }