private void listView1_SelectedIndexChanged(object sender, EventArgs e) { if (listView1.SelectedIndices.Count <= 0) { return; } int selectedIndex = listView1.SelectedIndices[0]; if (selectedIndex < 0) { return; } string type = ""; int j = 0; while (type == "") { type = listView1.Items[selectedIndex - j].SubItems[0].Text; j++; } int i = 1; string id = listView1.Items[selectedIndex].SubItems[i++].Text; string name = listView1.Items[selectedIndex].SubItems[i++].Text; string memberID = listView1.Items[selectedIndex].SubItems[i++].Text; string date = listView1.Items[selectedIndex].SubItems[i++].Text; string time = listView1.Items[selectedIndex].SubItems[i++].Text; string minutes = listView1.Items[selectedIndex].SubItems[i++].Text; string pic = listView1.Items[selectedIndex].SubItems[i].Text; FormRptShowPictureEvent frm = new FormRptShowPictureEvent(id, type, name, memberID, date, time, minutes, pic); this.Hide(); frm.Show(); frm.Disposed += frm_Disposed; }
private void ShowPicture(int idToShow, int index) { if (isAnnuals[index]) { FormRptShowPictureAnnual fr = new FormRptShowPictureAnnual(idToShow, dataConnection); this.Hide(); fr.Show(); fr.Disposed += fr_Disposed; } else { FormRptShowPictureEvent fr = new FormRptShowPictureEvent(idToShow, dataConnection); this.Hide(); fr.Show(); fr.Disposed += fr_Disposed; } }