使用 TListView 控件(2)
本例效果图:

代码文件:
unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls; type
TForm1 = class(TForm)
ListView1: TListView;
Button1: TButton;
Button2: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject);
begin
ListView1.Align := alLeft;
Button1.Caption := '添加';
Button2.Caption := '清空';
RadioButton1.Caption := 'ViewStyle = vsIcon';
RadioButton2.Caption := 'ViewStyle = vsList';
RadioButton3.Caption := 'ViewStyle = vsReport';
RadioButton1.Checked := True;
end; procedure TForm1.Button1Click(Sender: TObject);
var
item: TListItem;
begin
item := ListView1.Items.Add;
item.Caption := 'Item' + IntToStr(ListView1.Items.Count);
end; procedure TForm1.Button2Click(Sender: TObject);
begin
ListView1.Clear;
end; procedure TForm1.RadioButton1Click(Sender: TObject);
begin
ListView1.ViewStyle := vsIcon; {这是默认值}
end; procedure TForm1.RadioButton2Click(Sender: TObject);
begin
ListView1.ViewStyle := vsList;
end; procedure TForm1.RadioButton3Click(Sender: TObject);
begin
ListView1.ViewStyle := vsReport;
if ListView1.Columns.Count = then ListView1.Columns.Add.Caption := '标题';
end; end.
窗体文件:
object Form1: TForm1
Left =
Top =
Caption = 'Form1'
ClientHeight =
ClientWidth =
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch =
TextHeight =
object ListView1: TListView
Left =
Top =
Width =
Height =
Columns = <>
TabOrder =
end
object Button1: TButton
Left =
Top =
Width =
Height =
Caption = 'Button1'
TabOrder =
OnClick = Button1Click
end
object Button2: TButton
Left =
Top =
Width =
Height =
Caption = 'Button2'
TabOrder =
OnClick = Button2Click
end
object RadioButton1: TRadioButton
Left =
Top =
Width =
Height =
Caption = 'RadioButton1'
TabOrder =
OnClick = RadioButton1Click
end
object RadioButton2: TRadioButton
Left =
Top =
Width =
Height =
Caption = 'RadioButton2'
TabOrder =
OnClick = RadioButton2Click
end
object RadioButton3: TRadioButton
Left =
Top =
Width =
Height =
Caption = 'RadioButton3'
TabOrder =
OnClick = RadioButton3Click
end
end
使用 TListView 控件(2)的更多相关文章
- Delphi的TListView控件拖放选定行操作
http://www.tansoo.cn/?p=401 Delphi的TListView控件拖放选定行操作的例子,效果图如下:TListView控件拖动选定行到指定位置 具体实现步骤: 一.新建一个D ...
- c++ builder TListView控件按字符串排序(根据网上代码亲测ok)
//--------------------------------------------------------------------------- /* 首先将一个列表框控件安放在Form上, ...
- 使用 TListView 控件(4)
本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, ...
- TListView控件的ReadOnly属性的一个Bug
不知道是不是ListView的 ReadOnly属性的一个bug 1.Form上一个ListView,如图设置 2.在FormCreate事件中写如下代码: ListView1->Rea ...
- 教程-Delphi第三方控件安装卸载指南
1 只有一个DCU文件的组件.DCU文件是编译好的单元文件,这样的组件是作者不想把源码公布.一般来说,作者必须说明此组件适合Delphi的哪种版本,如果版本不对,在安装时就会出现错误.也正是因为没有源 ...
- Delphi 7 里没有加载的控件
在原来版本如D5.D6中使用的控件如Quickrep,FastNet等,在D7中仍然是保留的.只是Delphi没有将他们默认的安装到组件面版中来.这些控件包全部保存在Delphi目录的bin下,文件扩 ...
- 教程-Delphi7 自带控件安装对应表
原来的控件delphi7里何处寻? 经常有朋友提这样的问题,“我原来在delphi5或者delphi6中用的很熟的控件到哪里去了?是不是在delphi7中没有了呢?这是不是意味着我以前写的代码全都不能 ...
- Delphi中解析Xml的控件-SimDesign NativeXml
Delphi中解析Xml的控件-SimDesign NativeXml 正在学习,感觉应用很方便.无源代码的版本还是免费的. SimDesign.NativeXml是一个delphi和bcb的XML控 ...
- Delphi在Listview中加入Edit控件
原帖 : http://www.cnblogs.com/hssbsw/archive/2012/06/03/2533092.html Listview是一个非常有用的控件,我们常常将大量的数据(如数据 ...
随机推荐
- 【TOJ 3005】Triangle(判断点是否在三角形内+卡精度)
描述 Given the coordinates of the vertices of a triangle,And a point. You just need to judge whether t ...
- linux系统之-vi编辑器
在linux系统使用中,掌握熟练的vi编辑器,可以提高linux工作效率.那么vi编辑器的使用方法有哪些呢? vi编辑器可在绝大部分linux发行版中使用. Vi编辑器的作用:创建或修改文件:维护li ...
- DevOps - 版本控制 - GitHub
README Badges 徽章 Shields.io: Quality metadata badges for open source projects 徽章 官网:https://shields ...
- python 装饰器 生成及原里
# 装饰器形成的过程 : 最简单的装饰器 有返回值的 有一个参数 万能参数 # 装饰器的作用 # 原则 :开放封闭原则 # 语法糖 :@ # 装饰器的固定模式 #不懂技术 import time # ...
- 对URI的理解
在了解RESTful api的设计规范的时候,遇到了一个问题,就是uri和url有什关系,有什么区别,所以就在这里记录一下. URI(Uniform Resource Identifier),统一资源 ...
- ts包、表、子表、section的关系
我们经常接触到创建 DEMUX,注册 Filter 过滤数据, 通过回调过滤出 section 数据,然后我们对 section 数据做具体的解析或者其他操作. 我们这里说的 section 就是段的 ...
- WPF中,如何将Vista Aero效果扩展到整个窗口
原文:WPF中,如何将Vista Aero效果扩展到整个窗口 WPF中,如何将Vista Aero效果扩展到整个窗口 ...
- 高德API+Python解决租房问题(.NET版)
源码地址:https://github.com/liguobao/58HouseSearch 在线地址:58公寓高德搜房(全国版):http://codelover.link:8080/ 周末闲着无事 ...
- Delphi实例之橡皮筋画图的实现
Delphi实例之橡皮筋画图的实现 在<Delphi7基础教程>这本书的练习中提到过一个橡皮筋画图的例子,书上的源码是错误的!不知道是打印的错误还是本身源码就有问题,我将它改了过来. 在F ...
- Wireshark lua dissector 对TCP消息包合并分析
应用程序发送的数据报都是流式的,IP不保证同一个一个应用数据包会被抓包后在同一个IP数据包中,因此对于使用自制dissector的时候需要考虑这种情况. Lua Dissector相关资料可以见:ht ...