CListView Column Images
Terry Trippany -- terryt@str.com
Wednesday, June 19, 1996
Environment: VC++ 4.1, NT 3.51/NT 4.0/Win95
I have an application whose main window has a splitter with a
CListView in the right pane. I am using a "Detail" or Report view
with multiple columns. Does anyone know how to insert images into
the column headers as opposed to text?
I have searched extensively through the MSDN, and other resources
to no avail.
Thanks,
Terry Trippany - terryt@str.com
Gregg Tavares -- greggt@biggrub.com
Friday, June 21, 1996
[Mini-digest: 2 responses]
See the ROWLIST example that comes with VC++4.1 It draws it's own list =
items. Modify the draw routine to draw the images you need.
Search for ROWLIST
The problem is, only a string is stored for sub items (I believe it's =
only a string). For the main item there is a 4 bit state field and a 4 =
bit overlay field which, if you are drawing your own stuff, you can use =
to store info (I used them to store the on/off bits for a bunch of state =
images in my list) Also, Each item in the list has an associated =
LV_ITEM structure that you can access. The lParam field allows you to =
associate a 32 bit value (like a pointer to your data) with each item. =20
-Gregg
-----From: Roger Onslow/Newcastle/Computer Systems Australia/AU
Note sure of details but you should be able to something like this
Get the pointer to the header control of the list control (its a child)
Then you should be able set it's style to owner-draw
Then handle the drawing message for the window
Would need to find time to research this further to give you details
But this might give you a starting place to try something yourself.
Roger Onslow
Computer Systems Australia
| Вернуться в корень Архива
|