什么意思搞不明白,是不是象下面一样?
TMyThread = class(TThread)
private
child : TForm;
childform : TForm;
public
procedure draw;
constructor Create(parent : TForm);
destructor Destroy;
procedure Execute; override; end;
constructor TMyThread.Create(parent: TForm);
begin
child := parent;
inherited Create(false);
end;destructor TMyThread.Destroy;
begin
if Assigned(childform) then
FreeAndNil(childform);
end;procedure TMyThread.draw;
var i:integer;
begin
begin
childform := TForm.Create(nil);
childform.Caption := 'OK';
childform.Parent := child;
childform.Show;
end;
end;
procedure TMyThread.Execute;
begin
inherited;
synchronize(draw);
if Terminated then Exit;
end;procedure TForm1.Button1Click(Sender: TObject);begin
TMythread.Create(Form1);
end;
TMyThread = class(TThread)
private
child : TForm;
childform : TForm;
public
procedure draw;
constructor Create(parent : TForm);
destructor Destroy;
procedure Execute; override; end;
constructor TMyThread.Create(parent: TForm);
begin
child := parent;
inherited Create(false);
end;destructor TMyThread.Destroy;
begin
if Assigned(childform) then
FreeAndNil(childform);
end;procedure TMyThread.draw;
var i:integer;
begin
begin
childform := TForm.Create(nil);
childform.Caption := 'OK';
childform.Parent := child;
childform.Show;
end;
end;
procedure TMyThread.Execute;
begin
inherited;
synchronize(draw);
if Terminated then Exit;
end;procedure TForm1.Button1Click(Sender: TObject);begin
TMythread.Create(Form1);
end;
解决方案 »
- 这些键盘代码分别代表什么键?
- 这句话是什么意思 怎么看不懂啊
- Delphi7下怎么用Socket??
- 正在開發人事考勤薪資系統﹐各位大哥提點意見。
- 实现李维《Delphi6/Kylix2 SOAP/WebService程序设计篇》11章的例子遇到的关于COM+的问题,大侠看看!
- 表中有1000条纪录,我要从头到尾每隔5条记录抽取一条记录形成一个查询,如何写sql语句?
- 谁有Delphi的注册码?
- 我有个button和一个Panel控件,我想点击第一下button,弹出Panel孔件,点击第二下button,Panel控件隐藏(panel的visible属性设置为false),请问该button怎么写?
- 请众位高手指点迷津,如何实现数据库的过滤,用RadioGroup 与 Edit 作为查找字段
- 有关关闭form的问题,刚才没有说清楚
- 如何通过API在TMemo尾部追加一个字符,仅仅是追加一个字符,不是增加一行。(急急急)
- 自己写程序编译Delphi源程序!!!
是:procedure TMyThread.Execute;
begin
while not Terminated do
begin
try
MyExcel:=CreateOleObject('Excel.application');
except
showmessage('error!');
end;
end;
end;
能讲的清楚点吗?
老实说我对线程不是很了解,有谁能帮帮我吗?