문제

In Visual Studio whenever you select an item, the item become highlighted. I want to take advantage of this property to retrieve the checked item that is currently being highlighted (out of all the item in the checkedlistbox)

Is this operation possible?

도움이 되었습니까?

해결책

The CheckedListBox control always seemed rather half-baked to me, so I don't use it often.

Something like this works:

With CheckedListBox1
  If .SelectedIndex > -1 Then
    If .CheckedIndices.Contains(.SelectedIndex) Then
      MessageBox.Show(.SelectedItem.ToString & " is checked.")
    Else
      MessageBox.Show(.SelectedItem.ToString & " is not checked.")
    End If
  End If
End With
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top