473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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
Expand|Select|Wrap|Line Numbers
  1. 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
Sep 13 '08 #1
3 1249
Shashi Sadasivan
1,435 Expert 1GB
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?
Sep 13 '08 #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?

i've tried to create a loop but it gives me error.
Sep 13 '08 #3
cloud255
427 Expert 256MB
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.
Sep 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: paradox | last post by:
I want to have a TreeView that shows an image on some items, but not all. Basically, if a certain condition is true, a caution icon is placed next to the treeview item. The problem is that, by...
11
by: Juan Romero | last post by:
Hey guys, I have an ImageList control that stores my icons. What I need to do is find out if the icon at hand already exists in the ImageList so I dont enter it twice. How can I do that? ...
4
by: Just Me | last post by:
If I add an image to an imagelist using imageList.Images.Add... And use it with a tree node tn.ImageIndex = imageList.Images.Count-1 This is the actual code:...
0
by: Andre Viens | last post by:
Hello, I am using the following variation of code from <http://support.microsoft.com/default.aspx?scid=kb;EN-US;319340> to add icons to an imagelist for use in a listview: Private Structure...
2
by: sonu | last post by:
Hi, I have a problem for use of imagelist. The problem is I have written a code which returns me the icons associated with the files depending on their type. After getting the icon for the...
4
by: Omega | last post by:
Hi, I have an ImageList and I want to use it at design time in several forms, how can I do it ? Ok, I can copy the ImageList from one form and paste it on the new form, but these ImageLists...
6
by: Udi | last post by:
Hi, I have an imagelist initialized in design time with several icons files (.ico). However, when I need to extract an icon (Image) from the Imagelist, I can't convert it back to an icon: ...
0
by: gene kelley | last post by:
(using VS2005) I want to add an icon to TreeView nodes. 1) To a new project (VB or C#) I add a sample TreeView with some sample nodes. I add an ImageList component, and add one icon image. I...
1
by: =?Utf-8?B?QWRhbQ==?= | last post by:
I'm having a problem loading an Icon into an ImageList. When I load the icon directly it works fine, like this: Icon sourceIcon = << Get an icon from somewhere... >>;...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.