images in list view

R

RobcPettit

Hi, I have a 'star' in my imagelist and I use:
listView.SmallImageList = imageList1;
ListViewItem itemSize = listView.Items.Add(new
ListViewItem("",0)); to add this to my listview. All works ok. What Id
like to know is, this displays 1 star in the cell, is it possible to
add more than 1 star to that cell. Ive seen examples were stars are
used as ratings, but cant tell if there using the same star many
times. Or creating there own images with several stars in, then adding
these to imagelist.
Regards Robert
 
P

Peter Duniho

Hi, I have a 'star' in my imagelist and I use:
listView.SmallImageList = imageList1;
ListViewItem itemSize = listView.Items.Add(new
ListViewItem("",0)); to add this to my listview. All works ok. What Id
like to know is, this displays 1 star in the cell, is it possible to
add more than 1 star to that cell. Ive seen examples were stars are
used as ratings, but cant tell if there using the same star many
times. Or creating there own images with several stars in, then adding
these to imagelist.

The item in the ListView can only have the one image. You can, of course,
display as many stars as you like in that one image, assuming they fit in
the image you provide.

I would expect that most commonly if you want to display multi-star
ratings in a ListView, you would provide an ImageList that has all of the
variations you expect to display (e.g. five images, one image for each
number of stars from one to five), and then assign the appropriate image
index to a given item in the ListView.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top