Question

I have a series of checkboxes that I want to allow the user to check multiple items. I need to identify which boxes are checked (In a loop I assume) and return the content of the CHECKED check boxes and then query that content in order to display any item that contains those attributes.

Thanks

Was it helpful?

Solution

Unless you are creating the checkboxes at runtime, I would not loop through them, just ask for the value of each one. (Important that you NAME your checkboxes in your XAML so you can access them by name)

If CheckBox1.IsChecked Then
  '... What to do when checked
Else
  '... What to do when not checked
End If
If CheckBox2.IsChecked Then
  '... What to do when checked
Else
  '... What to do when not checked
End If
If CheckBox3.IsChecked Then
  '... What to do when checked
Else
  '... What to do when not checked
End If
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top