如何在列表视图控件三态中制作复选框? [英] How to make checkboxes in a list view control tri-state?

查看:22
本文介绍了如何在列表视图控件三态中制作复选框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使列表视图控件中的复选框具有 LVS_EX_CHECKBOXES 样式三态(具有 BS_3STATE 按钮样式)?我正在使用 WTL,但我可以手动发送消息.

Is it possible to make the checkboxes in a list view control with LVS_EX_CHECKBOXES style tri-state (having BS_3STATE button style)? I'm using WTL but I'm OK manually sending messages around.

推荐答案

是的,您需要一个 ImageList,其中包含未选中、选中和不确定复选框的 3 个图像.调用 ListView_SetImageList() 来分配 LVSIL_STATE 图像列表.操作 LVITEM.state 以显示您想要的复选框类型.

Yes, you need an ImageList with 3 images of a unchecked, checked and indeterminate checkbox. Call ListView_SetImageList() to assign the LVSIL_STATE image list. Manipulate LVITEM.state to display the kind of checkbox you want.

这篇关于如何在列表视图控件三态中制作复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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