hi
i need to insert for each row in listview a diffrent image
how i can do it? when i try to do it i always see the sdame picture
thanks
have a nice day
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ahmad ShabanPosted Mar 26, 2006, 4:48 AM
To set a different icon to each listviewitem ( forget WORD row )
public
void ImageGo( ListView MyView ){
int MyNumber = 0; foreach ( ListViewItem AnItem in MyView.Items ){
AnItem.ImageIndex = MyNumber;
MyNumber++;
}
}
well the idea is each ListViewItem has an IconIndex
so if you have an ImageList that holds 4 Images then the first Icon has the Index = 0 then 1 and so on
so you need to assign a different index to each listviewitem (row)
this done by incrementing ++