?
Solved

Beginner... ListView component. Please help...

Posted on 2003-03-20
3
Medium Priority
?
197 Views
Last Modified: 2010-04-04
Okay this question is very basic. VERY basic, actually. But for some reason I am having problems using the ListView component. I'm not sure exactly how to use it.

Lets say I have 3 columns and I want to add integers inside using a for do loop.

For example, lets say I want it to look like...

[Col A][Col B][Col C]
 0      0      0
 1      1      1
 2      2      2
 3      3      3
... etc


i'm not sure how to access the individual columns. Could someone please help?
0
Comment
Question by:PoeticAudio
  • 2
3 Comments
 
LVL 6

Author Comment

by:PoeticAudio
ID: 8177197
That didnt come out exactly right...

the letters are the columns and the numbers are the rows.. like


ABC
---
000
111
222

...etc
0
 
LVL 1

Accepted Solution

by:
SJohnson earned 200 total points
ID: 8177478
ListViews took me a little while to get the hang of, but they are an EXTREMELY useful component.

var
  Root: TListItem;
  Count: Integer;
begin
  ListView1.Items.Clear;
  for Count := 0 to 10 do
    begin
      Root := ListView1.Items.Add;
      Root.Caption := IntToStr(Count); //Column 0

      //The SubItems property is just a TString.
      Root.SubItems.Add(IntToStr(Count));
    end;
end;

You need to create your columns either at design time or runtime.  

Cheers,

Stuart.
0
 
LVL 6

Author Comment

by:PoeticAudio
ID: 8181957
GREAT! Thanks Stuart! -=) I didn't realize it was that easy... as they say... "you da man"

Best Regards,
Steve
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

593 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