473,769 Members | 6,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image List

Hi all
Is there any limit of images which can be added to a image list. I
have a problem with this control. I added an image list in design mode
and I am adding images using code. Then I want to use images in a
listview, and each time I am trying to call an image at index 15 or
above I have an error stating that there isn't any object at that
index. I was debbuging it and there was more there was 22 images, but
only 15 I can load.

Is there any way I can add and display more than 15 images. What is
causing that problem?

Thanks

Mar 8 '07 #1
3 2852
I doubt there is a limit, but it would probably help us if you posted your
code
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

<gr************ @googlemail.com wrote in message
news:11******** **************@ c51g2000cwc.goo glegroups.com.. .
Hi all
Is there any limit of images which can be added to a image list. I
have a problem with this control. I added an image list in design mode
and I am adding images using code. Then I want to use images in a
listview, and each time I am trying to call an image at index 15 or
above I have an error stating that there isn't any object at that
index. I was debbuging it and there was more there was 22 images, but
only 15 I can load.

Is there any way I can add and display more than 15 images. What is
causing that problem?

Thanks

Mar 8 '07 #2
You can have more than 15 images in an imagelist control.

Not sure of the limitations but way more than 15 I think I had 200 or so
(they were only littel 32x32 icons though)

Mike.
<gr************ @googlemail.com wrote in message
news:11******** **************@ c51g2000cwc.goo glegroups.com.. .
Hi all
Is there any limit of images which can be added to a image list. I
have a problem with this control. I added an image list in design mode
and I am adding images using code. Then I want to use images in a
listview, and each time I am trying to call an image at index 15 or
above I have an error stating that there isn't any object at that
index. I was debbuging it and there was more there was 22 images, but
only 15 I can load.

Is there any way I can add and display more than 15 images. What is
causing that problem?

Thanks

Mar 8 '07 #3
On 8 Mar, 23:26, "Nathan Sokalski" <njsokal...@hot mail.comwrote:
I doubt there is a limit, but it would probably help us if you posted your
code
--
Nathan Sokalski
njsokal...@hotm ail.comhttp://www.nathansokal ski.com/

<grzegorz.ga... @googlemail.com wrote in message

news:11******** **************@ c51g2000cwc.goo glegroups.com.. .
Hi all
Is there any limit of images which can be added to a image list. I
have a problem with this control. I added an image list in design mode
and I am adding images using code. Then I want to use images in a
listview, and each time I am trying to call an image at index 15 or
above I have an error stating that there isn't any object at that
index. I was debbuging it and there was more there was 22 images, but
only 15 I can load.
Is there any way I can add and display more than 15 images. What is
causing that problem?
Thanks
Ok I am posting some code

Dim imgFlag As Image

sCountry = LookUpDetails(r ow("ip").ToStri ng)
newRow = dsReport.Tables ("Countries").R ows.Find(sCount ry)
If newRow Is Nothing Then
newRow = dsReport.Tables ("Countries").N ewRow
newRow("Country Name") = sCountry
newRow("Country Hits") = CInt(row("hits" ).ToString)
newRow("Country Visitors") = 1
newRow("Country Code") =
LookUpCountryCo de(row("ip").To String)
Try
'Adding image to ImageList
imgFlag = Image.FromFile( sImagePath &
newRow("Country Code").ToString .ToLower & ".gif")

ilCountries.Ima ges.Add(newRow( "CountryCode"). ToString, imgFlag)

Catch ex As IO.FileNotFound Exception
EventLog.WriteE ntry("LogAnalys t", "Image file was
not found. Path for desired image: " & sImagePath &
newRow("Country Code").ToString .ToLower & ".gif",
EventLogEntryTy pe.Error, 100)
End Try

dsReport.Tables ("Countries").R ows.Add(newRow)
Else
newRow("Country Hits") += CInt(row("hits" ).ToString)
newRow("Country Visitors") += 1
End If

And another bit where error appears

Dim item As ListViewItem

If rows.Length 0 Then
StatAnalyst.Lis tView2.StateIma geList =
StatAnalyst.ilC ountries
For Each row In rows
item = New
ListViewItem(ro w("CountryName" ).ToString)
Try
item.StateImage Index =
StatAnalyst.ilC ountries.Images .IndexOfKey(row ("CountryCode") .ToString)
Catch
End Try
item.SubItems.A dd(row("Country Hits").ToString )
item.SubItems.A dd(row("Country Visitors").ToSt ring)
StatAnalyst.Lis tView2.Items.Ad d(item)
Next
End If

Error message from exception:
System.Argument OutOfRangeExcep tion: InvalidArgument =Value of '21' is
not valid for 'StateImageInde x'.
Parameter name: StateImageIndex
at System.Windows. Forms.ListViewI tem.set_StateIm ageIndex(Int32
value)
at Stat_Analyzer.R eports.CreateCo untries() in Path\Stat Analyzer
\Stat Analyzer\Report s.vb:line 112

At the moment when error appears there are 22 images in ListView. On
ListView only 15 are displayed properly, only 15 appeared.

I have the same problem with another ListView in which I have 16
items. That list was created using design mode, but when I was trying
to add image from index 15 I got the same error as above.

Mar 9 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11763
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
1
6090
by: Desigan Chinniah | last post by:
I am presently trying to display a list of items INLINE using an image as a seperator..... and having difficulties.... See below for 3 seperate sets of html and css files. Each set does something different. Ideally I would like the result of Menu 1 but instead of having the pipe effect border on the right of each choice I would like to replace that with an image of some sort. Any help much appreciated.
6
16074
by: Haines Brown | last post by:
I find that when I use list-style-image with galeon or mozilla, padding is inserted between the symbol image and the following list text, while under IE 5.0 it seems to be inserted before the image instead of after it. li.up { list-style-image: url(../bin/arrow.png); height: 1.4em; margin-left: -0.4em; }
1
3343
by: Ronny | last post by:
Hi, When ever I use image lists in a tree view the image list is behaving inconsistent. When I add images they first look good and clean, after I have close and open the code in the IDE the icons have this blue shadow on them and they look really bad. I can then remove the icons and add them again and for some reason they look good but only until I add new icons to the same image list. Another thing I noticed is that when I add the...
4
41806
by: Gabriella | last post by:
hi, I am writing a simple bulleted list with ul/li, with my image as the list-style-image, and for some reason the image bullet on IE only (FF is fine) is vertically aligned to the top. Meaning, the bullet image is aligned to the TOP of the text following it. In FF the image is aligned to the center of the text following it, as it should. What am I doing wrong? ul {
4
1611
by: Mark | last post by:
Hi I notice that in some cases, to get an icon, an object (for example a list view) uses an image list, in others (e.g. a form) the image is selected from the project resources, i.e. a file. As I have images that I'd like to use in both situations I would like to use the same method for each. Preferably, as I find importing images as resources as often as not crashes VS, I would like to work with an image list.
6
7238
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to display an image. document.images only seems to reference image tags. The collection needs to include background images, input type = image, image maps, css assigned background, etc. Honestly, I am probably not aware of all the possibilities...
5
9854
by: Roy Smith | last post by:
Be kind to me, I'm a CSS newbie... I've been playing with drupal, building a web site (hyc-test.org). I started with the "sky" theme, but didn't like the way it rendered list items in menus. Spcifically, it started with: list-style-image: url(../../misc/menu-expanded.png);
0
1508
by: Lou O | last post by:
I have browsed and seen several posts on the subject but my issue seems to be unique. I have an image control on a form that updates on the after update event of a list box on the control. For each each item in the list box there is a corresponding jpg image displayed. Moving through the list items displays each corresponding image correctly. Double clicking the list box opens an editing form that can change the image. If the image is...
1
2574
by: Angelo | last post by:
Hi all, I am having a very annoying problem when using an unordered list in my aspx page. I set a UL style to use a custom image as the list style image but it does not show in the screen. I have tried it in a couple different ways but still no go. I have tried inline styles as well as using a style sheet class but it just doesn't show the image on the <lielement. The odd thing is that it will take the rest of the UL style but just not...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.