unit1.pas
来自「Delphi7应用编程150例附书源码.rar」· PAS 代码 · 共 54 行
PAS
54 行
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ImgList, StdCtrls;
type
TForm1 = class(TForm)
ListView1: TListView;
ImageList1: TImageList;
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
self.ListView1.Columns.Add();
self.ComboBox1.Items.Add('vsIcon');
self.ComboBox1.Items.Add('vsList');
self.ComboBox1.Items.Add('vsReport');
self.ComboBox1.Items.Add('vsSmallIcon');
self.ComboBox1.ItemIndex:=0;
self.ListView1.ViewStyle :=vsIcon
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if self.ComboBox1.ItemIndex=0 then
self.ListView1.ViewStyle :=vsIcon
else if self.ComboBox1.ItemIndex=1 then
self.ListView1.ViewStyle :=vsList
else if self.ComboBox1.ItemIndex=2 then
self.ListView1.ViewStyle :=vsReport
else
self.ListView1.ViewStyle :=vsSmallIcon;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?