Click to See Complete Forum and Search --> : Icons in Report-ViewStyle of ListView


AlionSolutions
June 11th, 2003, 07:06 AM
Hi,
again I have questions about comctrl, especially the ListView-Control:

I'm finnished with the TreeViews, so I have to learn some more stuff about ListViews. Ok, so I built a little C++-Wrapperclass
around it. The TreeViews were relatively easy stuff, but those ListViews break my neck.

1. I tried EVERYTHING to switch between the ViewStyles of the ListView programatically, and nothing worked. Has anybody an idea what I can try to get it working ?

2. MORE IMPORTANT !!! Ok, after messing around with ViewStyles, I decided to use the ViewStyle that suits my Application most and keep it fixed, and this is the report-style.
Ok, after learning about columns, and the fact, that no item may be added before having at least one column, my report-style-ListView looks and works fine... except for one thing:
There are no icons at the left of the report-items, like in windows-explorer and other apps in explorer-style. I added image-lists (the big and the small ones) to the ListView and set the LVIF_IMAGE-maskflag when inserting items... no icons :-(
My question is: What to do, to get icons displayed at the left side of my ListView-items in report-viewstyle ?

I read the tutorial at codeguru about using ListViews, but it didn't help me at my problems.

Thanx in advance for your help

Juergen

HeartBreakKid
June 11th, 2003, 08:44 AM
Are you doing you're own drawing of the control (Owner draw, or custom draw)? Post the code where you create your image list and add the images to it.

AlionSolutions
June 11th, 2003, 09:00 AM
Hi HBK,
this is complicated, since I created several c++-classes for this, like Image, ImageList,ListView,ListViewItem etc. and the functionality is spread across various functions.

I tried to make a selection of functions to post here, but I think it is too much code to post and to understand.

So, is there another way we can figure this out ? What do you mean with OwnerDraw and CustomDraw ? I didn't set anything explicit to be drawn in any way.

Thanx

Juergen

AlionSolutions
June 11th, 2003, 10:31 AM
Ok, the task of getting icons displayed is done. somewhat went wrong inside my object-framework.

But I still cannot get the viewstyle-switching to work.

I still appreciate any help on this.

greetinx

juergen

AlionSolutions
June 11th, 2003, 10:36 AM
the other problem is solved too :D

have a nice day

juergen