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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 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