Solved

Mark an row in a ListView

Posted on 2000-04-04
6
251 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
[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
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

730 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