Checking for & storing multiple CheckBox selections in CSharp.
- by Matt
I'm very new to CSharp and I can't seem to find a good solution to what I would consider a simple problem.
Basically I'm trying to determine which CheckBoxs have been selected by the user and then randomly generate combinations of the selections the user has made. As new as I am, I am aware that you can use a simple statement such as:
checkBox1.IsChecked == true
I could have a long set of if statements which update an array/collection, but I'm told that in Csharp there is a way of determining which CheckBoxs are checked by querying the GroupBox that the CheckBoxs are in. Unless I'm mistaken (which is very possible) this is achieved by using Control features, unfortunately I've not come across these yet in my learning so if someone could clear things up that would be great.
In summation, if someone has a simple solution for running through a set of checkBoxs and storing only the selected ones I would be most grateful.