📄 progressfrm.pas
字号:
unit ProgressFrm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, Buttons;
type
TProgressForm = class(TForm)
SpeedButton: TSpeedButton;
MsgLabel: TLabel;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ProgressForm: TProgressForm;
procedure ShowProgressForm(Msg: string; Show: Boolean = True);
implementation
{$R *.DFM}
uses MainFrm;
procedure ShowProgressForm(Msg: string; Show: Boolean = True);
begin
if Show then
begin
MHMainForm.Enabled := False;
Application.ProcessMessages;
if ProgressForm <> nil then
ProgressForm.BringToFront
else begin
ProgressForm := TProgressForm.Create(Application);
ProgressForm.Show;
end;
ProgressForm.MsgLabel.Caption := Msg;
ProgressForm.Refresh;
end else
begin
MHMainForm.Enabled := True;
if ProgressForm <> nil then
ProgressForm.Close;
end;
end;
procedure TProgressForm.FormCreate(Sender: TObject);
begin
SpeedButton.Left := 0;
SpeedButton.Top := 0;
Width := SpeedButton.Width;
Height := SpeedButton.Height;
end;
procedure TProgressForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
ProgressForm := nil;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -