Link to home
Start Free TrialLog in
Avatar of sneeuw
sneeuwFlag for Belgium

asked on

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

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 !!
Avatar of Madshi
Madshi

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.
Avatar of sneeuw

ASKER

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 ?
ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sneeuw

ASKER

OK Thanks !
I'll try it out !