Solved

Mark an row in a ListView

Posted on 2000-04-04
6
249 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using Delphi code in a Builder project that uses a DLL 3 114
how to understand recursion 12 226
Writing a parser for java language 4 78
Socket Programming (Unix) 8 127
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

770 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