//增加
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. springmvc上传,下载

    参考: 上传: 如下代码,可将上传内容复制到上传地址 file.transferTo(new File(realPath + File.separator + realName)); http://b ...

  2. php 公历阴历互相转换

    <?php /** * Created by PhpStorm. * User: timeless * Date: 17-3-9 * Time: 上午9:32 */ class Lunar { ...

  3. Android Selinux

    https://blog.csdn.net/rikeyone/article/details/84337115   如何快速定位SElinux问题并修复? https://blog.csdn.net/ ...

  4. 使用python删除一个文件或文件夹

    使用python删除一个文件或文件夹,需要使用os模块. import osos.remove(path) # path是文件的路径,如果这个路径是一个文件夹,则会抛出OSError的错误,这时需用用 ...

  5. collections模块和os模块

    collections模块 在内置数据类型(dict.list.set.tuple)的基础上,collections模块还提供了几个额外的数据类型:Counter.deque.defaultdict. ...

  6. eclipse下配置Spring环境

    工具: jdk1.8 win10 spring5.0 1.准备工作:下载Spring开发应用的插件,api 1.spring插件包:springsource-tool-suite-3.9.4.RELE ...

  7. Nordic NRF51822 从零开始系列(一)开发环境的搭建

    硬件准备     (1)nrf51822 开发板一块(此处使用的是青云系列的,自带jlijnk ob+usb串口芯片)或者使用nrf51822模块+jlink_ob                 ( ...

  8. 将多个图片合并到一个TIF文件里(非 GDAL) 优化版

    不知道为什么,网上对TIF的操作的资料少得可怜,包括CodeProject上都没有找到多少,在网上大多用GDAL,但这个东西,对只想做个合并图片的功能来说,实在是牛刀杀鸡,(9个DLL要带全,相当的恐 ...

  9. nunit2.5.7 单元测试时提示:“当前不会命中断点 还没有为该文档加载任何符号”

    解决方案: 因为项目的“目标框架”是.net4.5 所以要将对应的 nunit.exe.config 或 nunit-x86.exe.config 文件中加上: <startup> < ...

  10. 转载:Maplab开源VI-SLAM框架介绍

    https://blog.csdn.net/ccfiricen/article/details/79089694