“始终显示选择"在列表模式下对 CListCtrl 不起作用 [英] "Always show selection" doesn't work on CListCtrl in list mode
问题描述
我希望用户能够在我的 CListCtrl 中选择项目,然后单击按钮对这些项目进行操作.但是当焦点从列表中丢失时,选择不再显示,即使我将始终显示选择"设置为 true:
I want a user to be able to select item(s) in my CListCtrl and then click on a button to act on those items. But when the focus is lost from the list, the selection is no longer shown, even if I set 'Always show selection' to true:
这发生在对话测试工具和我编译的应用程序中.我使用列表模式,没有图标,只有文本.
This happens both in the dialog test facility, and in my compiled application. I use list-mode, and have no icons, only text.
- 在资源编辑器中创建一个新对话框
- 放置一个列表视图控件.
- 在属性中设置视图 = 列表
- 在属性中设置 Always Show Selection = True
- 在对话框中添加按钮
- 按 Ctrl-T 测试对话框
- 选择列表中的项目,然后按下按钮
推荐答案
..并且文本根本没有被明显选中.或者是......我可以在我的屏幕截图中几乎看不到一些非常微弱的选择 - 我思考.它太微弱了,我不能 100% 确定它在那里!
..and the text is not visibly selected at all. Or is it... I can just barely sort of see some very very faint selection in my screenshot - I think. It's so faint I am not 100% certain it's there!
除了我的评论:好吧,你知道了 - 它们被选中,和颜色不同,但似乎你的屏幕设置有点偏离.也许是您的颜色设置、高对比度模式或 Windows 中所选项目的颜色设置.
In addition to my comments: well, there you have it - they are selected, and in a different color, but it seems your screen settings are a bit off. Maybe your color settings, a high contrast mode, or the color setting for selected items in Windows.
屏幕截图中的灰色为:#f7f3f7 - 浅灰色,因此您可能无法看到它,具体取决于设置.
The gray color in your screenshot is: #f7f3f7 - light gray, so you might have a problem seeing it, depending on the settings.
一个有趣且非常轻便的工具来检查这些东西(放大,查看颜色值)是 ZoomPlus.我每天都在使用它,而且似乎也有可用的源代码.
An interesting and very lightweight tool to check those things (zoom in, see the color values) is ZoomPlus. I use it every day, and there seems to be source code available too.
这篇关于“始终显示选择"在列表模式下对 CListCtrl 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!