TlistView基本使用
//增加
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基本使用的更多相关文章
- Delphi TListView刷新闪烁问题
应用场景 TListView可以动态选择列并显示而且列宽度也要保存,加载数据ListView会出现N次闪烁 步骤一: 选择要显示列: 点击"确定"按钮,显示下图 步骤二: 界面会出 ...
- 修正 XE6 TListView 上方 SearchBok 右边的清除钮显示
注意:XE7 已修正这个问题. Delphi Firemonkey TListView 提供了搜寻的功能,但在 XE6 以前的版本,可以显示右边的清除按钮,在 XE6 确消失了,这里提供一个修正的方案 ...
- TListView Header重绘和高度设置
TListView 的 Header 部分默认 BtnFace 颜色,高度也不能改变.我们可以通过编写一些代码来实现这些功能: 获得TListView 的Header 的句柄: TListView的H ...
- TListView的一些操作
1,让滚动条滚动的API SetScrollPos int SetScrollPos( _In_ HWND hWnd, _In_ int nBar, _In_ int n ...
- Delphi的TListView控件拖放选定行操作
http://www.tansoo.cn/?p=401 Delphi的TListView控件拖放选定行操作的例子,效果图如下:TListView控件拖动选定行到指定位置 具体实现步骤: 一.新建一个D ...
- TListView列表拒绝添加重复信息
//TListView列表拒绝添加重复信息 procedure TForm1.Button1Click(Sender: TObject);var i: Integer;begin if (Tr ...
- delphi列表视图组件(TListView)使用方法|实例
TListView 组件以多种形式显示列表的项目,如详细资料.小图标.大图标等形式表示列表中的项目. 列表视图与用TListBox 组件实现的列表框非常相似.不同的是,列表视图可以让用户选择不同 ...
- 使用 TListView 控件(4)
本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, ...
- FMX TListView 搜索 Search
FMX,FireMonkey,平台框架下TListView控件搜索.过滤. 查找功能确实强大!! 设置SearchVisibe属性为true,就自动显示搜索框,输入文字,就开始检索了,不用写一行代码! ...
- 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 ...
随机推荐
- 《objective-c基础教程》学习笔记 (一)—— 开发环境配置和简单类型输出
懒惰是富有最大的敌人,再不前进,我们就out了.最近工作比较轻松,不是很忙.于是想晚上下班回家学习点新东西.看着苹果大军的一天天壮大,心里也是痒痒的.于是就想先系统的学习下Objective-C,为之 ...
- 大杂烩 -- HashMap、HashTable、ConCurrentHashMap 联系与区别
基础大杂烩 -- 目录 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1. Hashtable 和 HashMap ⑴ ...
- lua第三方库
一.Lua 包管理工具 1.LuaRocks luarocks 是Lua常用的包管理工具(还有一个是LuaDist),其安装方式请参考官网:https://luarocks.org/#quick-st ...
- 【应用安全】S-SDLC安全开发生命周期
0x01 S-SDLC简介 OWASP Secure Software Development Lifecycle Project(S-SDLC)是OWASP组织首个由OWASP中国团队独立发布并主导 ...
- iOS - NSURLProtocol详解和应用
问题:因dns发生域名劫持 需要手动将URL请求的域名重定向到指定的IP地址 最近在项目里由于电信那边发生dns发生域名劫持,因此需要手动将URL请求的域名重定向到指定的IP地址,但是由于请求可能是通 ...
- Windows-NTFS-ADS在渗透测试中的利用
0.什么是ADS Windows:微软公司的一款视窗操作系统,其内核为WindowsNT. NTFS:WindowsNT环境的限制级专用文件系统. ADS:NTFS的系统特性,交换数据流(Altern ...
- jQuery学习之二
jQuery对象获取方法:var $cr=$("#cr"); //jQuery方法获取的是一个·对象数组. var cr=$cr[0] // var cr=$cr.get(0); ...
- meat http-equiv 属性详解
转自 http://kinglyhum.iteye.com/blog/827807 http-equiv 属性提供了 content 属性的信息/值的 HTTP 头. http-equiv 属性可用于 ...
- ThinkPHP框架 自定义 Empty 方法保护本地信息不被暴露!!!
在使用ThinkPHP框架开发过程中,在每个Controller文件夹里面都要设置一个空控制器,用来保护本地信息不被泄露(EmptyController.class.php) 此方法很有效的隐藏系统内 ...
- 如何迁移完整SQL数据库到另外一台服务器
如何迁移完整SQL数据库到另外一台服务器: https://jingyan.baidu.com/album/9f7e7ec080d1b36f28155422.html?picindex=1