private void btnedit_Click_1(object sender, EventArgs e) { EditPerson editPerson = new EditPerson(); editPerson.mijnpersoon = (Persoon)lbpersoon.SelectedValue; if (editPerson.ShowDialog() == DialogResult.OK) { } }
private void btnedit_Click(object sender, EventArgs e) { EditPerson editPerson = new EditPerson(); var selectedPersoon = (Persoon)lbpersoon.SelectedItem; editPerson.mijnpersoon = selectedPersoon; if (editPerson.ShowDialog() == DialogResult.OK) { } }