开发者

ListView Custom Draw - Multi-colored text inside individual cell?

As far as I know you can use Custom Draw in a list-view to pa开发者_JAVA百科int individual cells the way you want using CDDS_SUBITEM.

However, I would like to have multi-colored text within a cell. That is, I would like to, for example, set a cell's text to: "this program is called the [start red text]Red Program[end red text]" - is there a way to accomplish this?


Well, in your NMCUSTOMDRAW structure you get an HDC. You will need to call DrawText multiple times. You may be able to just call SetTextColor to do that, or you may have to call SelectObject and select in your own custom Pen to change the color... yay GDI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜