3

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:

enter image description here

enter image description here

This happens both in the dialog test facility, and in my compiled application. I use list-mode, and have no icons, only text.

To reproduce:

  • Create a new dialog in the resource editor
  • Place a list-view control.
  • Set View = List in the properties
  • Set Always Show Selection = True in the properties
  • Add a button to the dialog
  • Press Ctrl-T to test the dialog
  • Select item(s) on the list, then press the button

enter image description here

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
  • "Always show delection" works great for me on a CListCtrl in report mode. – Jabberwocky Jan 22 '16 at 13:07
  • It seems the icons remain selected in a less obvious colour, but text is not selected. When you are only displaying text (as I am) it just doesn't seem to work at all. – Mr. Boy Jan 22 '16 at 13:12
  • 1
    I cannot reproduce the behavior you describe. Please provide an [MCVE](http://stackoverflow.com/help/mcve) (and do make it minimal). – IInspectable Jan 22 '16 at 13:16
  • @IInspectable I'm not quite sure how to here... the .rc file is rather central! But I added instructions, it is seen in the VS "test dialog" functionality without me even compiling my code. – Mr. Boy Jan 22 '16 at 13:25
  • Works fine here. They are even greyed in you screenshot. Could it be your monitor settings (brigtness/contrast) are a bit off? Or some windows settings? – Danny_ds Jan 22 '16 at 13:45
  • @Danny_ds could you perhaps take a screenshot before/after you click "Button1"? I can _just_ see the icon stays selected but it's barely visible, 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! – Mr. Boy Jan 22 '16 at 13:48
  • 1
    @Mr.Boy - Do you see the grayed text in your above screenshot on your monitor? It seems you clicked the button (has focus), and the selected items are greyed in your screenshot - but maybe you just don't see it because of your screen settigs (some high contrast mode maybe?). – Danny_ds Jan 22 '16 at 13:51
  • 1
    @Mr.Boy - FYI: the gray color is: #f7f3f7 (light gray) - maybe you could check your color settings (for selected items) for Windows too, and set them somewhat darker if they are not visible on your monitor. Or use a tool like [ZoomPlus](http://gipsysoft.com/zoomplus/) to zoom in and/or check the colors. – Danny_ds Jan 22 '16 at 13:56

1 Answers1

1

..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!

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.

The gray color in your screenshot is: #f7f3f7 - light gray, so you might have a problem seeing it, depending on the settings.

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.

Danny_ds
  • 11,201
  • 1
  • 24
  • 46
  • Well that's a little embarrassing but I'm glad to have figured it out. – Mr. Boy Jan 22 '16 at 14:26
  • @Mr.Boy - I have no comment on that :) (except maybe that I've had this too in the past, light gray that is hardly visible, depending on the screen(settings) ). And making them darker is no solution too, because we should stick to the default settings / user preferences. – Danny_ds Jan 22 '16 at 14:37