详细使用列表框 [英] Use a listbox in detail

查看:74
本文介绍了详细使用列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

createwindow("listbox",~~)
它会显示一个列表框,其中包含我存储的多个列表.
假设列表框中有以下列表.

凯尔

凯特

我要做的是仅为Jane更改名称颜色.通常是黑色的.
而且我有可能将数据放在特定的行中,例如跳过空白行的第二行或第七行.
请提出您的建议

createwindow("listbox", ~~)
it''s gonna show a listbox with several lists that I store.
Assuming that there are below lists in listbox.

Kyle
Jane
Kate

what I want to do is to change name color only for Jane. generally it''s black.
and is it possible that I can put data in specific line such as second line or seventh line skipping blank lines.
Please, give your advice

推荐答案

是的,可以使用ownerdrawn的CListBox.

创建控件时,需要使用LBS_OWNERDRAWVARIABLE(或LBS_OWNERDRAWFIXED)和其他所有者绘制的相关标志,然后再处理DrawItem和MeasureItem东西.
我不知道如何在直接Win32中正常运行,但是我认为这是一个好的开始.

最多
Yes, possible by using an ownerdrawn CListBox.

You need to use the LBS_OWNERDRAWVARIABLE (or LBS_OWNERDRAWFIXED ) and other owner drawn related flags when creating the control, and after than you have to handle the DrawItem and MeasureItem stuff.

I don''t know how that works exacly in straight Win32, but I think it''s a good start.

Max.


这篇关于详细使用列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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