Solved

ListView control, selected item to remain highlighted when control looses focus

Posted on 2007-11-21
5
479 Views
Last Modified: 2013-11-20
I'm using a couple of list controls on the same dialog and I want the selection in the first list control to remain highlighted when I make a selction in the second list control

Thanks
PS, the link to the solutiion to this question preveously asked is not valid anymore.
0
Comment
Question by:EnergyStorage
  • 2
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 20329889
Resourrce editor, select the list control
property - show selection always - set it to true (ticked)
0
 

Author Comment

by:EnergyStorage
ID: 20329947
Thanks Andy, I should have know it was so simple, Arrg!
How would I go about setting the selection / not focus selection colours?
Randy
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 20330037
Much more complex  - owner draw or custom draw I think would be what you require.
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 20330067
>>>>> How would I go about setting the selection / not focus selection colours?
That isn't so easy. You need to derive your own list control class from CListCtrl, switch ot owner draw in the resources, replace the class member by your class so that the DoDataExchange can make the subclassing,  supply the DrawItem member function, make all drawing yourself in that function

Regards, Alex
0
 

Author Comment

by:EnergyStorage
ID: 20330137
Thanks guys,
Ok thanks, I've done the more complex list control using the XListCtrl demo from the Code Project
http://www.codeproject.com/listctrl/xlistctrl.asp

I just thought there might be an easy way to change the colours used.
Randy
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

820 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