12-03-2010, 03:58 PM
عفوا الخطأ كان مني قلت التركيز :oops:
كود :
unit MY_THREAD2;
interface
uses
Classes,Windows,StdCtrls,SysUtils;
type
TMY_THREAD2 = class(TThread)
private
My_Label : TLabel;
{ Déclarations privées }
protected
procedure Execute; override;
public
constructor create(LABEL_Display : TLabel);
end;
implementation
constructor TMY_THREAD2.create(LABEL_Display: TLabel);
begin
FreeOnTerminate:=True;//le thread sera detruit a la fin de l'execution
inherited create(False);//appel au constructor original
My_Label:=LABEL_Display;
end;
procedure TMY_THREAD2.Execute;
var
count : integer;
begin
count :=0;
repeat
Sleep(100);
inc(count);
My_Label.Caption:=IntToStr(count);
until count [color=Red]>=[/color]10;
end;
end.
