为CListCtrl中的单词设置颜色 [英] Set color for a word in a CListCtrl

查看:112
本文介绍了为CListCtrl中的单词设置颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个CListCtrl. CListCtrl的第一列包含句子,即第一列的每个单元格都有一个句子.我知道可以设置单个单元格的颜色.是否有可能将颜色设置为单个单元格中包含的句子中的特定单词.就像单元格中有今天是星期二"这样的句子一样,星期二可以以其他颜色显示吗?

Hi,
I have a CListCtrl. The first column of the CListCtrl has sentences, i.e. each cell of the first column has a sentence. I know that it is possible to set the color of individual cells. Is there any possible way for setting color to a specific word in the sentence contained in a single cell. Like if a cell has the sentence, "Today is Tuesday", can Tuesday be displayed in a different color?

推荐答案

您是否尝试过使用ListCtrl的自定义绘制通知.

如果在自定义绘制中比较困难,则可以重写DrawItem()

问候
拉达克里希南(Radhakrishnan G.)
Have you try with custom draw notification from ListCtrl.

If it is difficult in custom draw you can override DrawItem()

Regards
Radhakrishnan G.


这篇关于为CListCtrl中的单词设置颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆