Apply imagelist icon to all items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • George21
    New Member
    • Sep 2008
    • 12

    Apply imagelist icon to all items

    Hello. I'd like to know how i can to add the same icon from the imagelist to all of Listview items using for loop, i know that this code
    Code:
    listView1.Items[0].ImageIndex = 3;
    sets the first list item to display the 4th image but i'm trying to set only one icon for all items in listview,can anyone help me?
    Thanx
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Create a loop for all items and set the image for it.

    1 more line of code and it would be done.

    Is that what you are asking for?

    Comment

    • George21
      New Member
      • Sep 2008
      • 12

      #3
      Originally posted by Shashi Sadasivan
      Create a loop for all items and set the image for it.

      1 more line of code and it would be done.

      Is that what you are asking for?

      i've tried to create a loop but it gives me error.

      Comment

      • cloud255
        Recognized Expert Contributor
        • Jun 2008
        • 427

        #4
        Originally posted by George21
        i've tried to create a loop but it gives me error.
        Post the loop so that we can see where the error comes from.

        Comment

        Working...