//增加
procedure TForm1.Button1Click(Sender: TObject);
var
lsItem: TListItem;
begin
lsItem := ListView1.Items.Add;
lsItem.Caption := VarToStr(ListView1.Items.Count);
lsItem.SubItems.Add(edit1.Text);
lsItem.SubItems.Add(edit2.Text); edit1.Text := '';
Edit2.Text := '';
end;

//修改
procedure TForm1.Button2Click(Sender: TObject);
begin
ListView1.Selected.SubItems.Strings[] := Edit1.Text;
ListView1.Selected.SubItems.Strings[] := edit2.Text;
end;

//删除
procedure TForm1.Button3Click(Sender: TObject);
begin
ListView1.DeleteSelected;
edit1.Text := '';
Edit2.Text := '';
end;//点击项目取值
procedure TForm1.ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
begin
edit1.Text := Item.SubItems.Strings[];
Edit2.Text := Item.SubItems.Strings[];
end;
//循环判断Checkbox是否选中
procedure TForm1.Button4Click(Sender: TObject);
var
i: Integer;
begin
memo1.Clear;
for i := to ListView1.Items.Count - do
begin
if ListView1.Items.Item[i].Checked then
begin
memo1.Lines.Add(ListView1.Items.Item[i].Caption);
memo1.Lines.Add(ListView1.Items.Item[i].SubItems.Strings[]);
memo1.Lines.Add(ListView1.Items.Item[i].SubItems.Strings[]);
end; end;
end;

TlistView基本使用的更多相关文章

  1. Delphi TListView刷新闪烁问题

    应用场景 TListView可以动态选择列并显示而且列宽度也要保存,加载数据ListView会出现N次闪烁 步骤一: 选择要显示列: 点击"确定"按钮,显示下图 步骤二: 界面会出 ...

  2. 修正 XE6 TListView 上方 SearchBok 右边的清除钮显示

    注意:XE7 已修正这个问题. Delphi Firemonkey TListView 提供了搜寻的功能,但在 XE6 以前的版本,可以显示右边的清除按钮,在 XE6 确消失了,这里提供一个修正的方案 ...

  3. TListView Header重绘和高度设置

    TListView 的 Header 部分默认 BtnFace 颜色,高度也不能改变.我们可以通过编写一些代码来实现这些功能: 获得TListView 的Header 的句柄: TListView的H ...

  4. TListView的一些操作

    1,让滚动条滚动的API SetScrollPos int SetScrollPos(     _In_  HWND hWnd,     _In_  int nBar,     _In_  int n ...

  5. Delphi的TListView控件拖放选定行操作

    http://www.tansoo.cn/?p=401 Delphi的TListView控件拖放选定行操作的例子,效果图如下:TListView控件拖动选定行到指定位置 具体实现步骤: 一.新建一个D ...

  6. TListView列表拒绝添加重复信息

      //TListView列表拒绝添加重复信息 procedure TForm1.Button1Click(Sender: TObject);var  i: Integer;begin  if (Tr ...

  7. delphi列表视图组件(TListView)使用方法|实例

    TListView 组件以多种形式显示列表的项目,如详细资料.小图标.大图标等形式表示列表中的项目.    列表视图与用TListBox 组件实现的列表框非常相似.不同的是,列表视图可以让用户选择不同 ...

  8. 使用 TListView 控件(4)

    本例效果图: 代码文件: unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, ...

  9. FMX TListView 搜索 Search

    FMX,FireMonkey,平台框架下TListView控件搜索.过滤. 查找功能确实强大!! 设置SearchVisibe属性为true,就自动显示搜索框,输入文字,就开始检索了,不用写一行代码! ...

  10. Implementing the On Item Checked Event for the TListView Control

    The TListView Delphi control displays a list of items in a fashion similar to how Windows Explorer d ...

随机推荐

  1. SpringBoot------Maven Clean报错

    报错信息: Plugin org.apache.maven.plugins:maven-clean-plugin: or one of its dependencies could not be re ...

  2. 《Python3网络爬虫开发实战》

    推荐:★ ★ ★ ★ ★ 第1章 开发环境配置 第2章 网页基础知识 第3章 网络爬虫基础 第4章 基本库的使用 第5章 解析库的使用 第6章 数据存储 第7章 Ajax数据爬取 第8章 动态渲染页面 ...

  3. Ubuntu14.04下安装redis-3.2.0以及开机自启动

    去官网下载Redis-3.2.0.tar.gz,将redis-3.2.0.tar.gz放入/opt目录下 解压redis-3.2.0.tar.gz xiaoyao@xiaoyao-virtual-ma ...

  4. Ubuntu屏幕录像软件推荐-Kazam

    sudo apt-get install kazam https://blog.csdn.net/weixin_40153532/article/details/79337630

  5. [原]openstack-kilo--issue(十九) ImportError: Could not import settings 'openstack_dashboard.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named main

    查看此问题的时候请先查看 这个问题包含在(十)中,此篇只是从(十)中分离出来 openstack-kilo--issue(十)ERROR: openstack Unable to establish ...

  6. db first和code first

    1. db first 是现有数据库,再写代码.根据数据库的表生成类. django里面:python manage.py  inspectdb 2. code first 是先写代码,后创建数据库. ...

  7. 网络推送通知:及时,相关和准确 (navigator.serviceWorker.register(), window.PushManager, new Notification)

    google网络推送通知 https://developers.google.cn/web/fundamentals/push-notifications/ 服务工作线程:简介server worle ...

  8. python 中 try ...except

    捕捉异常 try: 下的代码段 即为 需要捕捉异常的代码段: except:  捕获某一模块的异常,须带异常模块名称,可带原因参数:except 下代码为该异常发生时,所执行的代码:一个try可对应多 ...

  9. 线段树 || BZOJ 1112: [POI2008]砖块Klo

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1112 题解: 希望有连续K柱的高度是一样的,就先把1~K的数扔进线段树(线段树的下标就是数值 ...

  10. 泡泡一分钟:Towards real-time unsupervised monocular depth estimation on CPU

    Towards real-time unsupervised monocular depth estimation on CPU Matteo Poggi , Filippo Aleotti , Fa ...