private void targetBtn_Click(object sender, EventArgs e) { UnitPicker unitPicker = new UnitPicker(Units); unitPicker.UnitPicked += UnitPicked; unitPicker.StartPosition = FormStartPosition.CenterParent; unitPicker.ShowDialog(); }
private void UnitPicked(object sender, UnitEventArgs e) { PickedUnit = e.Unit; UpdateData(); UnitPicker unitPicker = (UnitPicker)sender; unitPicker.Close(); }