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

📄 untmain.pas

📁 每隔一段时间会自动提醒一下用眼过度:) 特别适合长时间使用电脑的人
💻 PAS
字号:
unit UntMain;

interface

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

type
  TForm1 = class(TForm)
    SpeedButton1: TSpeedButton;
    Timer1: TTimer;
    Label1: TLabel;
    Timer2: TTimer;
    GroupBox1: TGroupBox;
    Label2: TLabel;
    SpeedButton2: TSpeedButton;
    Label3: TLabel;
    Image1: TImage;

    procedure SpeedButton1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
  private
    { Private declarations }
    count:  Integer;
  public
    { Public declarations }
  end;

const
  COUNT_MAX = 60;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
  Hide;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Hide;
  GroupBox1.Left := Round((Form1.Width - GroupBox1.Width)/2);
  GroupBox1.Top := Round((Form1.Height - GroupBox1.Height)/2);
  Timer1.Enabled := False;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
  count := count + 1;
  if count = COUNT_MAX then begin
    count := 0;
    Show;
  end;
end;

procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
  close;
end;

end.

⌨️ 快捷键说明

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