方法为
线程类:
//unit2.pas
type
  ss = class(TThread)
  private
   procedure mm;
    { Private declarations }
  protected
    procedure Execute; override;  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 ss.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }{ ss }procedure ss.Execute;
begin
Synchronize(mm); { Place thread code here }
end;
procedure ss.mm;
var mm:TForm;
begin
mm:=tform.Create(nil);
mm.ShowModal;
end;
//unit1.pas
var mm:ss;
begin
mm:=ss.Create(true);
mm.Resume;
end;