Solved

How to make the listctrl item selected(not greyed but with blue background)  even when the focus is not in listctrl

Posted on 2000-03-31
5
402 Views
Last Modified: 2013-11-20
Hi Guys,

I want the item in the listctrl to remain selected when not in focus. I know that LVS_SHOWSELALWAYS makes it highlighted but it is like a disabled text. I want it to remain with blue background and white text. This is there in clistbox. But not in list ctrl.
Do you know any other way?
0
Comment
Question by:vmadhipatla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
gelbert earned 100 total points
ID: 2673421
Take a look at http://codeguru.developer.com/listview/LVHighlight.shtml
Idea is the same: change way how item is highlighted
0
 
LVL 8

Expert Comment

by:gelbert
ID: 2673427
By the way, ahother good artical on the same topic
http://www.codeproject.com/listctrl/LVCustomDraw.asp
0
 
LVL 1

Author Comment

by:vmadhipatla
ID: 2679900
I myself figured it out that SetItemState(nIndex,LVIS_DROPHILITED,LVIS_DROPHILITED) will make it highlited in blue and it remains highlited even if the focus is not in control. The only thing is we have to make sure that we remove the highlite each time another item is selected.

Anyway, i'll accept gelbert's comment as answer and provide him the points promised.

Thanks
venkatesh

0
 
LVL 1

Author Comment

by:vmadhipatla
ID: 2679918
Gelbert's suggested site provides some more good way of handling the highliting of listcontrol. Even though i figured it out myself, i think the coding given in gelbert's site provides good answer to this most common problem faced by developers.

regards
venkatesh
0
 
LVL 1

Author Comment

by:vmadhipatla
ID: 2822849
Hi Guys,

I found the problem.
I had a
OnUpdateTbrbtnright(CCmdUI* pCmdUI)
for one of the toolbar buttons.
It was checking for Curpos and i think
this was continuously in a loop obstructing the tooltip message.

I think i'll delete the question.

Regards
Venkatesh
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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