Solved

Getting ListView to work.

Posted on 1998-07-30
1
145 Views
Last Modified: 2010-04-04
Could someone please post an example of how to get the ListView component to work. I have it setup for a report view with 2 columns. I just can't seem to get it too add items and sub items. I'm using version 3.0.
Thanks
0
Comment
Question by:LostOne
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 100 total points
ID: 1359289
Hi

Have you set up your listview's columns?  This is an example which adds 2 columns, then some data to a listview.  (My listview is called lvTest.)

  // Set the view style.
  lvTest.ViewStyle := vsReport;

  // Add some columns.
  with lvTest.Columns.Add do
    begin
      Caption := 'First Column';
      Width := 100;
    end;
  with lvTest.Columns.Add do
    begin
      Caption := 'Second Column';
      Width := 100;
    end;

  // Add some items.
  with lvTest.Items.Add do
    begin
      Caption := 'First Caption';
      SubItems.Add('This is in 2nd col.');
    end;
  with lvTest.Items.Add do
    begin
      Caption := 'Second Caption';
      SubItems.Add('This is in 2nd col.');
    end;

Cheers,
JB
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

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…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

16 Experts available now in Live!

Get 1:1 Help Now