public void ActivateOption(string selectedItem) { _activeSpinner = null; for (int i = 0; i < _buttons.Count; i++) { if (_buttons[i] is QuantitySpinner) { if (_buttons[i].CaptionText == selectedItem) { ((QuantitySpinner)_buttons[i]).Active = true; _activeSpinner = ((QuantitySpinner)_buttons[i]); } else { ((QuantitySpinner)_buttons[i]).Active = false; } } } }