Solved

ListCtrl item highlight color when control not focused

Posted on 1997-10-24
2
336 Views
Last Modified: 2013-11-20
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
Comment
Question by:crank
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 10 total points
ID: 1308738
You must use owner draw list control and implement custom paint for various states.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1308739
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question