J
jlutt-sadan
Unregistered / Unconfirmed
GUEST, unregistred user!
修改如下
第一步:
procedure TMyThread.Execute;
begin
//inherited;
with TForm3.Create(fOwner)do
begin
ShowModal;
Free;
end;
end;
第二步:
将show方法移入Synchronize中,否则拖动showmodal窗体,form1不刷新
TMyThread = class(TThread)
private
fOwner: TForm;
protected
proceduredo
Show;
procedure Execute;
override;
public
constructor Create(vOwner: TForm);
destructor Destroy;
override;
end;
procedure TMyThread.DoShow;
begin
with TForm2.Create(fOwner)do
begin
ShowModal;
Free;
end;
end;
procedure TMyThread.Execute;
begin
Synchronize(DoShow);
end;
第一步:
procedure TMyThread.Execute;
begin
//inherited;
with TForm3.Create(fOwner)do
begin
ShowModal;
Free;
end;
end;
第二步:
将show方法移入Synchronize中,否则拖动showmodal窗体,form1不刷新
TMyThread = class(TThread)
private
fOwner: TForm;
protected
proceduredo
Show;
procedure Execute;
override;
public
constructor Create(vOwner: TForm);
destructor Destroy;
override;
end;
procedure TMyThread.DoShow;
begin
with TForm2.Create(fOwner)do
begin
ShowModal;
Free;
end;
end;
procedure TMyThread.Execute;
begin
Synchronize(DoShow);
end;