uviewf.pas
来自「图书管理系统 用于进行图书的管理」· PAS 代码 · 共 72 行
PAS
72 行
unit uViewF;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, ExtCtrls;
type
TViewF = class(TForm)
Button1: TButton;
Panel1: TPanel;
ListView1: TListView;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
constructor Create(ACaption : string; AListView : TListView;
AOwner:TComponent);
end;
var
ViewF: TViewF;
implementation
{$R *.DFM}
constructor TViewF.Create(ACaption: string; AListView: TListView;
AOwner: TComponent);
var
i , j : integer;
begin
inherited Create(AOwner);
self.Ctl3D := False;
Color := clBtnFace;
Caption := ACaption;
for i := 0 to AListView.Columns.Count -1 do
begin
with ListView1.Columns.Add do
begin
Width := AListView.Columns[i].Width;
Caption := AListView.Columns[i].Caption;
end;
end;
for i := 0 to AListView.Items.Count-1 do
begin
with ListView1.Items.Add do
begin
Caption := AListView.Items[i].Caption;
for j := 0 to AListView.Columns.Count -2 do
SubItems.Add(AListView.Items[i].SubItems.Strings[j]);
end;
end;
Show;
end;
procedure TViewF.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TViewF.Button1Click(Sender: TObject);
begin
Close;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?