如何将CListView中的复选框设置为禁用以供用户更改 [英] How to set the checkbox in CListView to be disable for user to change

查看:130
本文介绍了如何将CListView中的复选框设置为禁用以供用户更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将CListView中的复选框设置为禁用以供用户更改?
但用户不仅可以双击CListView中的项目并单击它,还可以通过切换和控制进行多次选择.

How to set the checkbox in CListView to be disable for user to change?
But user can not only double click and click the item in CListView,but also can multiple select by shift and control.

推荐答案

在CListCtrl中没有禁用特定复选框的选项,但是您可以编写一个从CListCtrl派生的专用listctrl来执行此操作.将每个项目的状态存储在矢量中,然后您也可以
There isn't an option to disable a particular checkbox in CListCtrl, but you can write a dedicated listctrl derived from CListCtrl which does this. Store the state of each item in a vector and then you can also custom draw each item.

Also if it's an option have a look at CCheckListBox which has the option to disable items. Well not as powerful as CListCtrl.


这篇关于如何将CListView中的复选框设置为禁用以供用户更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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