Solved

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

Posted on 2000-04-30
4
540 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle global variables 4 80
How to debug For loops? 3 62
Problem working with dynamic array - help 2 35
Firemonkey Listview item popup menu ? 1 30
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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