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

📄 main.pas

📁 精彩编程百例51~75 其中有 cpu速度测试 检测声卡 查询内存信息 图像处理技巧 模拟放大镜效果等待
💻 PAS
字号:
unit Main;

interface

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

type
  TMainForm = class(TForm)
    Animate1: TAnimate;
    RadioGroup1: TRadioGroup;
    GoBitBtn: TBitBtn;
    StopBitBtn: TBitBtn;
    BitBtn1: TBitBtn;
    StatusText: TStaticText;
    Label1: TLabel;
    procedure GoBitBtnClick(Sender: TObject);
    procedure StopBitBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.DFM}

{ Define array types for easier assignments of the
  Animate object's CommonAvi property, and also the
  StatusText object that shows which animation is running. }
type
  aviKindArray = array[0 .. 7] of TCommonAvi;
  aviStringArray = array[0 .. 7] of String;

{ Define constant arrays containing the TCommonAvi values
  in the same order they appear in the RadioGroup object,
  and also strings for displaying in the StatusText object
  that shows which animation is running. }
const

  aviKinds: aviKindArray =
    (aviCopyFile,
     aviCopyFiles,
     aviDeleteFile,
     aviEmptyRecycle,
     aviFindComputer,
     aviFindFile,
     aviFindFolder,
     aviRecycleFile);

  aviStrings: aviStringArray =
    ('复制文件',
     '复制多个文件',
     '删除文件',
     '清空回收站',
     '搜索计算机',
     '搜索文件',
     '搜索文件夹',
     '删除文件到回收站');

{ Start selected animation. This event handler is assigned
  to the OnClick event for both the Go button and the
  RadioGroup1. Clicking Go or clicking a radio button starts
  the animation immediately. }
procedure TMainForm.GoBitBtnClick(Sender: TObject);
var
  AnimIndex: Integer;  // 动画类型索引
begin
  AnimIndex := RadioGroup1.ItemIndex;
  with Animate1 do
  begin
    StatusText.Caption := aviStrings[AnimIndex];
    CommonAVI := aviKinds[AnimIndex];
    Play(1, FrameCount, 0);  // 开始动画
  end;
end;


procedure TMainForm.StopBitBtnClick(Sender: TObject);
begin
  Animate1.Stop; // 暂停动画
  StatusText.Caption := '停止';
end;

end.

⌨️ 快捷键说明

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