//增加
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. jexl2 执行字符串Java代码

    一,引入jar包, <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-jexl --><depen ...

  2. [Algorithm] Warm-up puzzles

    闲下来后,需要讲最近涉及到的算法全部整理一下,有个indice,方便记忆宫殿的查找 MIT的算法课,地球上最好:https://ocw.mit.edu/courses/electrical-engin ...

  3. 路由查询命令tracert

    from:https://jingyan.baidu.com/article/9c69d48f4df25713c8024e66.html 在命令行中输入“tracert ”并在后面加入一个IP地址,可 ...

  4. ASP.NET应用使用Nginx做负载均衡遇到的一个问题

    客户在使用我们的某个应用遇到了性能瓶颈,于是决定增加多个节点减轻单节点的压力.部署方案: 1台Nginx服务器 2台应用服务器,每台两个站点(一个应用创建两个IIS站点.不同端口号) Nginx的配置 ...

  5. Android Training Caching Bitmaps 翻译

    原文:http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html 图片缓存 在Android开发中,加载一个图 ...

  6. 纯JS实现图片预览与等比例缩放和居中

    最近做项目时有一个需求,广告位图片上传时要预览,并且要等比例缩放和居中.已经保存的广告位图片显示时也要等比例缩放和居中.我使用了下面的代码实现,不过可能有一些小问题. <!DOCTYPE HTM ...

  7. ztree 文件夹类型的 树状图

    未套程序的源代码: 链接:http://pan.baidu.com/s/1nuHbxhf 密码:4aw2 已套程序的源代码: css样式: /*发布邮件 选择领导弹窗*/ .xuandao{ disp ...

  8. ipv6禁用导致rpcbind服务启动失败解决办法

    参考文档:http://blog.51cto.com/hld1992/2055028

  9. Druid 在有赞的实践

    https://mp.weixin.qq.com/s?__biz=MzAxOTY5MDMxNA==&mid=2455759407&idx=1&sn=28390d7f5b2685 ...

  10. 下载隐含的qq音乐

    最终按Ctrl+s .或者点击“下载”即可.格式可能为m4a