i got a ListView in the windows form.When form loads ListView loading with personel objects. I want to do when some user double clicks on ListView , gets the personel object fro
In the new form that will be opened, add a new property in the form class;
private PERSONNEL Personnel{get; set;}
public ShowPersonnel(PERSONNEL _personnel){
this.Personnel = _personnel;
//do whatever you want here
}
In the main form;
private void listView1_SelectedIndexChanged(object sender, EventArgs e){
PERSONNEL personnel = listView1.SelectedItems[0].Tag as PERSONNEL;
Form2 form2 = new Form2();
form2.ShowPersonnel(personnel);
form2.Show();
}
May include typos. Change PERSONNEL to PERSONEL.