L
logpie
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
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
TMythread=class(Tthread)
private
newstr:string;
protected
procedure Execute;override;
Public
constructor Create(ns:string);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
constructor TMythread.Create(ns:string);
begin
newstr:=ns;
inherited create(false);
end;
procedure Tmythread.Execute ;
begin
FreeonTerminate :=true;
showmessage(newstr);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
tmythread.Create('nnn');
end;
end.
出错:CANVAS DOES NOT ALLOW DRAWING
如把如果我把SHOWMEESAGE(NEWSTR);该成FORM1。CAPTION:=NEWSTR;
标题拦是空的,没有错误信息
怎么回事?
interface
uses
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
TMythread=class(Tthread)
private
newstr:string;
protected
procedure Execute;override;
Public
constructor Create(ns:string);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
constructor TMythread.Create(ns:string);
begin
newstr:=ns;
inherited create(false);
end;
procedure Tmythread.Execute ;
begin
FreeonTerminate :=true;
showmessage(newstr);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
tmythread.Create('nnn');
end;
end.
出错:CANVAS DOES NOT ALLOW DRAWING
如把如果我把SHOWMEESAGE(NEWSTR);该成FORM1。CAPTION:=NEWSTR;
标题拦是空的,没有错误信息
怎么回事?