unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
type
     TNumthread = class(TThread)
  private
    { Private declarations }
  protected
    procedure Execute; override;
  public
    Tag:Integer;
    Suffix:String;
    LoadFirst:Integer;
    Can:Boolean;
    Procedure AddPicToBit;
    Procedure EveryPicToBit(Index:Integer);
end;
var
  Form1: TForm1;
  loadThread:TNumthread;
implementation{$R *.dfm}
procedure Tnumthread.Execute;
begin
  AddPicToBit;
end;
Procedure TNumThread.AddPicToBit;
begin
  EveryPicToBit(tag);
end;
Procedure TNumThread.EveryPicToBit(Index:Integer);
begin
  form1.Caption :=inttostr(index);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  loadthread:=Tnumthread.Create(True);
  loadthread.Tag:=5;
  loadthread.Resume;
end;end.
另外我在另一个程序中窗体Picform.pas中用同样的线程,用到窗体变量就换错,不知道什么原因