Question Adding Icons to List View Items

Rod

Member
Joined
Oct 10, 2008
Messages
11
Location
Peterborough, UK
Programming Experience
1-3
Hi Guys,

Im pretty new to programming, I have recently taken a new job as software developer after teaching myself VB and SQL code.

I have a problem....

I want to add icons to the rows in the 8th column of a ListView control, the icons should change depending on certain conditions.

So...

My ListView has a column called "Due Date", I want to display 1 of 6 icons next to the text items depending on how many days are left until it is due. I can write a For Loop and a Function to get which item should be displayed, no problem, but before I do that, I need to just display any item to see that it will work!!

The ListView items are taken from an SQL database, so can we add the icons after they have been filled? I can add items to the first column by:

lvContactSessions.items(2).imageindex = 1
lvContactSessions.items(1).imageindex = 3

This produces:

ListView.jpg


So my question is simply, how do I get this in the "Due Date" column?

Sorry if I'm waffling a bit!!

Thanks in advance,

Rod
 
Nobody knows huh?

I found out that you can only add icons to the first column :D So I did that.

Is it possible to make a custom control to do this? How difficult do you think, it would be to someone failry new to VS2008
 
It would't be easy. But it's totally possible, it's just a collection based control with a few bells and whistles. I'm not sure how best to advise you as I don't know how much time you want to spend on this. I'm happy to help you make one but it will take a while.
 
Thank you mate,

I do appreciate that, however I think it is best if at the moment, I should carry on learning other things. I would like to give this a go though, perhaps, if you're still willing to help in a few months?

Thanks
 
Back
Top