Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

ListCtrl item highlight color when control not focused

How can I set the color that is used for the highlighted (selected) item in a list control when the list control does not have the focus?
I am using the LVS_SHOWSELALWAYS style so that the selection is shown even when the control does not have the focus.  However, the highlight is changed to grey when focus leaves the control and if the system color for windows is set to grey, then the highlight cannot be seen. I know this can be done with owner-drawn controls, but I'm hoping to avoid that.
0
crank
Asked:
crank
1 Solution
 
galkinCommented:
You must use owner draw list control and implement custom paint for various states.
0
 
RONSLOWCommented:
I am not sure what system color the list view control uses to draw it's higlights.  It is probably doing the correct thing, but whoever is changing the windows color scheme may not be being careful enough to ensure that colours are still distinct.

I'll see what I can find about the colour the control uses - you may just have to change another colour in the windows colour scheme to get a contrast.

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now