Solved

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

Posted on 2000-04-30
4
532 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
ID: 2765422
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
ID: 2765847
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
ID: 2765885
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
ID: 2767563
OK Thanks !
I'll try it out !
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

19 Experts available now in Live!

Get 1:1 Help Now