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
397 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
  • 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

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: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now