public static RadioBtnGroup GetGroup(int id) { RadioBtnGroup group= null; for (int i = 0; i < groups.Count; ++i) { if(groups[i].groupID == id) { group = groups[i]; break; } } if (group == null) group = new RadioBtnGroup(id); return group; } }
public void SetGroup(int groupID) { if (this.group != null) { this.group.buttons.Remove(this); this.group = null; } this.radioGroup = groupID; this.group = RadioBtnGroup.GetGroup(groupID); this.group.buttons.Add(this); if (this.btnValue) { this.PopOtherButtonsInGroup(); } }