unit1.~pas

来自「通过读取电脑内部的数据」· ~PAS 代码 · 共 46 行

~PAS
46
字号
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Timer1: TTimer;
    TimeLabel: TLabel;
    ProgressBar1: TProgressBar;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  progressbar1.Position:=progressbar1.Min;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  timelabel.Caption:=timetostr(time);
  if progressbar1.Position<progressbar1.Max then
  progressbar1.StepIt
  else
  progressbar1.Position:=progressbar1.Min;
end;

end.

⌨️ 快捷键说明

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