tthread需要你自己来定义
一个示例
interface
uses  classes,Sysutils;type
  TKissXL=class(TThread)
  protected
    procedure execute;override;//此处为重载
  end;
implementation
uses unit1;
{ TKissXL }procedure TKissXL.execute;
var
  i:integer;
begin
  for i:=1 to 10000000 do
    form1.label1.caption:=inttostr(i);
end;end.
 

解决方案 »

  1.   

    我是在file->new->threahobject里面整的mythread,自动的放到了unit2,为什么不行呢?
    在unit1里面uses unit2了,mythread.create的自动提示也有,可就是没有execute,编译也说没有声明execute
      

  2.   

    我已经在unit2里面定义过execute了呀
      

  3.   

    protected execute;
    注意 protected 其实Create(true)后execute就执行了
      

  4.   

    对,这个我知道,可是我先create(false),然后要是想再运行怎么办?resume?
      

  5.   

    用: mythread1: myThread;
        mythread1:=myThread.create(true);
        execute() 可不调用,mythread1将自动运行.
      

  6.   

    我不想让它create以后就执行,不行么?
      

  7.   

    execute;//是一个protected的mythread1是无法直接访问的mythread1:=myThread.create(false); 就直接执行execute了mythread.create(true);//被挂起了只要唤醒即可
    mythread. Resume;即可
    相当于excute 的第一句是 Suspend