📄 waitformpas.pas
字号:
unit WaitFormPas;
interface
uses
Windows, Messages, SysUtils, WinProcs, Classes, Forms, ExtCtrls;
type
WaitThread = class(TThread)
private
{ Private declarations }
Waitform,temp:Tpanel;
protected
procedure Execute; override;
destructor destroy;override;
public
constructor Create(myform:tpanel);virtual;
end;
implementation
{ Important: Methods and properties of objects in VCL or CLX can only be used
in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure WaitThread.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ WaitThread }
constructor WaitThread.Create(myform:tpanel);
begin
inherited create(true);
temp:=myform;
FreeOnTerminate:=false;
waitform:=nil;
resume;
end;
procedure WaitThread.Execute;
begin
{ Place thread code here }
WaitForm:=Tpanel.Create(temp);
waitform.Parent :=temp;
waitform.Caption :='数据处理中,请稍后......';
end;
destructor WaitThread.destroy;
begin
waitform.Free ;
inherited
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -