About the use of Delphi ListView

Source: Internet
Author: User

Listview1.items as standard Tlistitems class

Listview1.items

(1) Assigning value

with ListView1.Items.Add do
begin
Caption:=caption; //添加第一项
SubItems.add(aaaaa); //添加后面数据
SubItems.add(1234);
SubItems.add(1234);
end; //一定要使用WITH结构.

(2) Take value

ListView1. Items.item[i]. Caption get a title of a piece of data

ListView1. Items.item[i]. SUBITEMS.STRINGS[J] Get a piece of data content

ListView1. Items.item[i].subitems.commatext the entire contents of a single record,

Format: "title", "Content 1", "Content 2",....

ListView1. Items.item[i]. Subitems.text the entire contents of a single record,

Format: Title, content, Content 2 ....

(3) Delete

ListView1. Items.item[i]. Delete; Delete a piece of data

(4) Definition of data type (length)

I:=listview1.items.count Number of data bars

ListView1. Items.item[i]. Selected this piece of data is selected (MultiSelect select check)

(5) Other

ListView1.Items.Clear; Purge data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.