Adding images to a listview

  • Thread starter Thread starter CaptainCaveman
  • Start date Start date
C

CaptainCaveman

Hi,

I'm trying to display a picture in my first list view column.

I've added the imagelist to my control as both a small image list and a
large image list, but the image is only drawn when it is assgned to the
small image list. This is no use to me as the image needs to be of a larger
size (thumbnail) but also requires additional information in subsequent
columns.

Does anyone know how to display a larger picture in column 1, then be able
to add data to subsequent columns for that ListViewItem?

TIA

CC
 
I'm trying to display a picture in my first list view column.

I've added the imagelist to my control as both a small image list and a
large image list, but the image is only drawn when it is assgned to the
small image list. This is no use to me as the image needs to be of a
larger size (thumbnail) but also requires additional information in
subsequent columns.

Does anyone know how to display a larger picture in column 1, then be able
to add data to subsequent columns for that ListViewItem?

When a list view is in Report (Details) view, it uses the small image list
as its source for images, period. The only way to do what you want is to go
the Owner Draw route. I recommend you look into it as it isn't really very
difficult to do. I used it once to draw a progress bar in a column. As long
as you aren't terrified by the concept of the Graphics class and maybe a
little bit of simple math (I'm talking addition and subtraction here, not
trig or anything), you'll be fine.
 
Back
Top