private void btnEdit_Click(object sender, EventArgs e) { Town town = (Town)bindSrcTowns.List[bindSrcTowns.Position]; fTown ft = new fTown(ref town); if (ft.ShowDialog() == DialogResult.OK) { bindSrcTowns.List[bindSrcTowns.Position] = town; } }
private void btnAdd_Click(object sender, EventArgs e) { Town town = new Town(); fTown ft = new fTown(ref town); if (ft.ShowDialog() == DialogResult.OK) { bindSrcTowns.Add(town); } }