private void AddProbButton_Click(object sender, EventArgs e) { var addProbeForm = new AddProbe(-1); DialogResult result = addProbeForm.ShowDialog(this); if (result == DialogResult.OK) { this.listView1.Items.Clear(); fillSampleList(); } }
private void doubleClickAction(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 1) { ListView.SelectedListViewItemCollection items = listView1.SelectedItems; int sampleId = Int32.Parse(items[0].SubItems[3].Text.ToString()); var addProbeForm = new AddProbe(sampleId); DialogResult result = addProbeForm.ShowDialog(this); if (result == DialogResult.OK) { this.listView1.Items.Clear(); fillSampleList(); } } }