/// <summary> /// Add a RadioButton to this RadioGroup /// </summary> /// <param name="radio">RadioButton</param> public void AddRadioButton(RadioButton radio) { if (this.RadioButtons != null) { if (this.RadioButtons.Contains(radio) == false) { this.RadioButtons.Add(radio); } } }
/// <summary> /// Delete the RadioButton from the RadioGroup /// </summary> /// <param name="radio">RadioButton</param> public void DeleteRadioButton(RadioButton radio) { if (this.RadioButtons != null) { if (this.RadioButtons.Contains(radio) == true) { this.RadioButtons.Remove(radio); radio.Dispose(); } } }
/// <summary> /// Initialise RadioGroup with one RadioButton /// </summary> /// <param name="parent">Parent Window</param> /// <param name="_firstRadio">One RadioButton</param> public RadioGroup(Window parent, RadioButton _firstRadio) : base(parent) { this.Enabled = true; this.Visible = true; this.Placement = RadioButtonPlacement.Vertical; this.RadioButtons = new List<RadioButton>(); this.AddRadioButton(_firstRadio); this.Parent.AddControl(this); }