문제

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

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top