Checked Listbox Text Color

  • Thread starter Thread starter jcrouse
  • Start date Start date
J

jcrouse

I am looping throught the items in a checked list box. If it helps, all
of the items are checked. If I string of text matches a certain
criteria I would like to change it's text color to red. I know this is
incorrect, but something like so:

If clbFinalList.Items(intLoopCount) = strBadA(x) Then
clbFinalList.Items(x).forecolor = Color.Red
End If

What is the proper syntax to accomplish this?

Thank you,
John
 
Assuming you're talking about the System.Windows.Forms.CheckedListBox class
then there is no built in support for that. You would have to ownerdraw it.
Consider using a ListView instead.

/claes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top