Solved

Mark an row in a ListView

Posted on 2000-04-04
6
244 Views
Last Modified: 2012-05-04
I have made a listview, which is only used in Reportview with fullrowselect.

My problem is to mark a specific line, as if you had clicked on it. Box around the line and changing the background colors (bit like inverting the line).

Is there anyone who knows how do that.

Kind Regards
Uffe Thomassen

I dont have any than 75 points
0
Comment
Question by:uffe_thomassen
  • 3
  • 2
6 Comments
 

Author Comment

by:uffe_thomassen
ID: 2683647
Adjusted points from 70 to 75
0
 

Expert Comment

by:degarn
ID: 2684236
Do you want this row to be selected ?
If yes, try pMyListiew->SetItemState(iItem , LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);

If you want your mark to be independant of the selection one(I don't really know what you intend to do) perhaps try the same function with LVIS_DROPHILITED rather then LVIS_SELECTED...

0
 
LVL 15

Expert Comment

by:NickRepin
ID: 2685474
ListView_SetExtendedListViewStyleEx(hWin,LVS_EX_FULLROWSELECT,LVS_EX_FULLROWSELECT);

But this only works if IE3.0 is installed, that is comctl32.dll has version 4.70.

0
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.

 

Author Comment

by:uffe_thomassen
ID: 2686651
Hi Nick, degarn

Degarn has found the right function, which I have tried before, but I have found out, it was becase I didn't had focus on the ListView, Stupid me.


I think it most fair that degarn gets my points so please send an answer.

0
 

Accepted Solution

by:
degarn earned 75 total points
ID: 2686779
Here it comes !
You know it often happens...
Now, I oftenly use the LVS_SHOWSELALWAYS style falg so that I always have an hilighted item (when listview not focused, you see it clearely...).

0
 

Author Comment

by:uffe_thomassen
ID: 2686813
Thanks degarn,

it was just the flag I nedded. It thats kind that, make life easy.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

760 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

21 Experts available now in Live!

Get 1:1 Help Now