我想在主窗口的OnCreat事件中新开一个线程,用来显示一个提示窗口,具体该怎么做啊?

解决方案 »

  1.   

    先写一个线程,再在OnCreate事件中调用这个线程。
      

  2.   

    怎么写啊?Delphi的帮助不怎么样
      

  3.   

    先new一个ThreadObject,这样就可以在这个线程中写要进行的操作了。
    调用:
     var
       yourthread1:yourthreadname;
    begin
      yourthread1:=yourthread.create(false);
    end;
      

  4.   

    下面的写法错在哪里,帮我看看吧!unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TMyThread = class(TThread)
      protected
        procedure Execute; override;
      end;  TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    var
      t:TMyThread;
    begin
      t.Create(false);
      t.Execute;
    end;{ TMyThread }procedure TMyThread.Execute;
    var
      m:TForm2;
    begin
      m:=TForm2.Create(nil);
      m.Show;
      inherited;
    end;end.