
05.12.2010, 16:18
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
MyThread = class(TThread)
private
str: String;
procedure Updt;
protected
procedure Execute; override;
end;
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ MyThread }
procedure MyThread.Execute;
begin
Synchronize(Updt);
end;
procedure MyThread.Updt;
begin
Form1.Memo1.Lines.Add(str);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
for i:=0 to 6 do
with MyThread.Create(True) do
begin
str:='Aaa'+IntToStr(i);
Resume;
Sleep(1);
end;
end;
end.
__________________
Пишу программы за еду.
__________________
|