public void ControlWasSelected(TrifectaPicksControl selectedCtrl) { if (_firstPositionCtrl != selectedCtrl) { _firstPositionCtrl.UnselectIt(); } if (_secondPositionCtrl != selectedCtrl) { _secondPositionCtrl.UnselectIt(); } if (_thirdPositionCtrl != selectedCtrl) { _thirdPositionCtrl.UnselectIt(); } selectedCtrl.SelectIt(); _selectedCtrl = selectedCtrl; PaintHorseNumberButtons(); }
private void LoadSelectionComponents() { _firstPositionCtrl = new TrifectaPicksControl("Position 1"); _secondPositionCtrl = new TrifectaPicksControl("Position 2"); _thirdPositionCtrl = new TrifectaPicksControl("Position 3"); _firstPositionCtrl.ControlSelectedEvent += ControlWasSelected; _secondPositionCtrl.ControlSelectedEvent += ControlWasSelected; _thirdPositionCtrl.ControlSelectedEvent += ControlWasSelected; _panelSelections.Controls.Add(_firstPositionCtrl); _panelSelections.Controls.Add(_secondPositionCtrl); _panelSelections.Controls.Add(_thirdPositionCtrl); }