Checked Listbox Text Color

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jcrouse

    Checked Listbox Text Color

    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.It ems(intLoopCoun t) = strBadA(x) Then
    clbFinalList.It ems(x).forecolo r = Color.Red
    End If

    What is the proper syntax to accomplish this?

    Thank you,
    John

  • Claes Bergefall

    #2
    Re: Checked Listbox Text Color

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

    /claes

    "jcrouse" <jcrouse1@hotma il.com> wrote in message
    news:1148652871 .352732.113520@ i39g2000cwa.goo glegroups.com.. .[color=blue]
    >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.It ems(intLoopCoun t) = strBadA(x) Then
    > clbFinalList.It ems(x).forecolo r = Color.Red
    > End If
    >
    > What is the proper syntax to accomplish this?
    >
    > Thank you,
    > John
    >[/color]


    Comment

    Working...