Solved

TListItem (ListView) member StateIndex cannot exceed 15 when linked to TImageList ?

Posted on 2000-04-30
4
529 Views
Last Modified: 2010-04-04
Howdy,

Using Borland cpp Builder 4.x

I use a ListView and have assigned an ImageList to the StateImages property.

So I can use e.g. :
ListItem->StateIndex = 5 ;
And icon 5 from the ImageList will be displayed next to the ListItem's normal icon.

This all works nicely untill value 14 !!
When I want to display icon 15 (or higher) I cannot seem to get the above mentioned mechanism to work !??????

Am I missing someting, Should I set another property ... ??

Help greatly appreciated !!
0
Comment
Question by:sneeuw
  • 2
  • 2
4 Comments
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
There's a limitation in the ListView component, not in Delphi's or BCB's component wrapper, but in Windows' ListView control itself.
StateImages are only thought to show up different states, normally you don't have more than 2 or 3 of these.
You should use the SmallImages instead.

Regards, Madshi.
0
 

Author Comment

by:sneeuw
Comment Utility
Damn Windows

I manage all icons in one ImageList and link all icon members to this one ImageList.
So SmallImages, StatImages, ... all link to the one ImageList.
So what you're saying is I should create another ImageList and manage the StateImages seperately ?
0
 
LVL 20

Accepted Solution

by:
Madshi earned 50 total points
Comment Utility
Yes! Or put the state images to the beginning of the one ImageList. That should work, too. But you'll never be able to use more than 14 (or whatever) state images in one ListView. I hope you don't need that.
0
 

Author Comment

by:sneeuw
Comment Utility
OK Thanks !
I'll try it out !
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now