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
401 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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