⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit2.pas

📁 ZIP压缩算法 delphi组件 含代码
💻 PAS
字号:
Unit Unit2;

Interface

{$I compiler.inc}
{$IFDEF DEL6_OR_HIGHER}
{$WARN UNIT_PLATFORM OFF}
{$ENDIF}

Uses
   Windows,
   Messages,
   SysUtils,
   Classes,
   Graphics,
   Controls,
   Forms,
   Dialogs,
   StdCtrls,
   FileCtrl,
   ExtCtrls,
   Buttons,
   ComCtrls,
   ztvGbls;

Type
   TForm2 = Class(TForm)
      Edit1: TEdit;
      Edit2: TEdit;
      Label1: TLabel;
      Label2: TLabel;
      Label3: TLabel;
      Label4: TLabel;
      BitBtn1: TBitBtn;
      BitBtn2: TBitBtn;
      Button1: TButton;
      ComboBox1: TComboBox;
      CheckBox1: TCheckBox;
      CheckBox2: TCheckBox;
      CheckBox3: TCheckBox;
      CheckBox4: TCheckBox;
      cbRecurseDirs: TCheckBox;
      FileListBox1: TFileListBox;
      DriveComboBox1: TDriveComboBox;
      DirectoryListBox1: TDirectoryListBox;
      Procedure BitBtn1Click(Sender: TObject);
      Procedure Button1Click(Sender: TObject);
      Procedure FormCreate(Sender: TObject);
      Procedure FormActivate(Sender: TObject);
      Procedure DirectoryListBox1Change(Sender: TObject);
   Private
   Public
   End;

Var
   Form2: TForm2;

Implementation

{$R *.DFM}
{$I defines.inc}

//-------------------------------------------------------------

// new folder button

Procedure TForm2.Button1Click(Sender: TObject);
Var
   Dir: String;
Begin
   Dir := DirectoryListBox1.Directory;
   If SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt], 0) Then
      DirectoryListBox1.Directory := Dir;
End;
//-------------------------------------------------------------

Procedure TForm2.DirectoryListBox1Change(Sender: TObject);
Begin
   Edit1.Text := DirectoryListBox1.Directory;
End;
//-------------------------------------------------------------

Procedure TForm2.FormCreate(Sender: TObject);
Begin
   ComboBox1.ItemIndex := 0;
End;
//-------------------------------------------------------------

Procedure TForm2.FormActivate(Sender: TObject);
Begin
   Edit1.Text := DirectoryListBox1.Directory;
   Edit1.SelLength := Length(Edit1.Text);
   Edit1.SetFocus();
End;
//-------------------------------------------------------------

Procedure TForm2.BitBtn1Click(Sender: TObject);
Var
   Dir: String;
Begin
   If Edit1.Text <> '' Then
   Begin
      Dir := AppendDirTail(Edit1.Text);
      If DirExists(Dir) Then
      Begin
         ModalResult := mrOK;
         DirectoryListBox1.Directory := Dir;
      End
      Else
      Begin
         ShowMessage(Dir + #13#13' ...not found.');
         Edit1.SetFocus;
      End;
   End;
End;
//-------------------------------------------------------------

End.

⌨️ 快捷键说明

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