我试过了:
- 如果 ListBox1.Items.Contains("myword") 那么
- 如果 ListBox1.SelectedIndex = ListBox1.Items.IndexOf("myword") 那么
- If ListBox1.SelectedItems.Item("myword") Then
但没有效果。
我试过了:
但没有效果。
尝试这样的事情,listbox.items属性是ListBox.ObjectCollection:
For Each i As Object In ListBox1.SelectedItems
If CStr(i).Contains("myword") Then
BackColor = Color.Blue ' Do your logic here, I just used setting the BackColor for a test
End If
Next