>>Hi,
>>
>>I have a window/form that has many check boxes. Each check box has a caption. I want to add a text box at the top of the form so that the user can search for any check box caption which contains the entered text. For example, when a user enters "fox", a method of the form will scan all check boxes and check if the caption has the word "fox." So far, it is all fairly easy to do.
>>
>>But then I want the substring of the caption to change the color (or make it bold). For example, if a check box has a caption
>>"Visual FoxPro" I want the word/substring "Fox" to be highlighted by a color or make it bold.
>>
>>Is this possible? And if yes, how? TIA
>
>Since you can't set color (forecolor or backcolor) for individual characters in a control, this will be hard. You could do something by dynamically overlaying controls that are appropriately colored, but there'll be a lot of overhead when it runs (assuming you're applying this to a bunch of controls).
>
>I wonder whether simply doing something with SelStart and SelLength would accomplish your goals at a lower cost.
>
>Tamar
As far as I know SelStart and SelLength do not apply to label but only to a text box.
And dynamically overlaying controls does not "feel" right. You used the right word "cost".
So, I ended up simply changing the color of the entire check box caption.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham