Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ImageList

Posted on 1999-07-18
4
Medium Priority
?
311 Views
Last Modified: 2012-05-04
Is there a way to add all the images in the ImageList to a ListView as an Item?
0
Comment
Question by:jackjoker
[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
4 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 1389434
All the images as an item? What do you mean?

Alex
0
 

Author Comment

by:jackjoker
ID: 1389435
Let's say the ImageList as 5 images.
I want to add 5 items to the ListView, with the five images front the ImageList respectively.
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 40 total points
ID: 1389436
Do it like this:

var
  ListItem : TListitem;

TheListView.LargeImages := MyImageList;

ListItem := ListView.Items.Add;
ListItem.Caption := 'An item';
ListItem.ImageIndex := 1; // lookup into images

Cheers,

Raymond.

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1389437
hi jackjoker,

more specified

procedure TForm1.Button1Click(Sender: TObject);
var
  Item : TListItem;
  I : Integer;
begin
  ListView1.LargeImages := ImageList1;
  ListView1.ViewStyle := vsIcon;
  for i := 0 to Imagelist1.Count - 1 do
  begin
    Item := ListView1.Items.Add;
    Item.ImageIndex := I;
    Item.Caption := 'Image '+IntToStr(I);
  end;
end;

meikl
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

715 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