main.pas

来自「《深入Delphi的多媒体编程》实例源代码」· PAS 代码 · 共 64 行

PAS
64
字号
unit main;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  FileCtrl, StdCtrls, ExtCtrls, Buttons;

type
  TMainForm = class(TForm)
    DriveComboBox1: TDriveComboBox;
    FilterComboBox1: TFilterComboBox;
    DirectoryListBox1: TDirectoryListBox;
    FileListBox1: TFileListBox;
    Label1: TLabel;
    Memo1: TMemo;
    BitBtn1: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure FileListBox1Click(Sender: TObject);
    procedure Memo1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

uses Bigpas;

{$R *.DFM}
procedure TMainForm.FileListBox1Click(Sender: TObject);//选择中文件阅读
begin
 if FileListBox1.FileName<>'' then
  begin
   Memo1.Lines.LoadFromFile(FileListBox1.FileName);
   Label1.Caption:='当前文件是:'+FileListBox1.FileName;
  end;
end;

procedure TMainForm.Memo1Click(Sender: TObject);//放大阅读
begin
 if FileListBox1.FileName<>'' then
  begin
   with BigForm do
    begin
     Memo1.Lines.LoadFromFile(FileListBox1.FileName);
     Caption:=FileListBox1.FileName;
     show;
    end;
  end;
end;

procedure TMainForm.BitBtn1Click(Sender: TObject);//关闭程序
begin
 Close;
end;


end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?