Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | unit GraphicControl1;
interface
uses
Windows, Messages, SysUtils, Classes, Controls,Graphics;
type
TGraphicControl1 = class (TGraphicControl)
private
FNum: integer ;
procedure SetNum(Value: integer );
protected
public
procedure Paint;override;
property Num: integer read FNum write SetNum;
published
end ;
...
procedure TNode . SetNum(Value: integer );
begin
if FNum<>Value then begin
FNum:=Value;
Canvas . Pen . Color:=clRed;
Canvas . Font . Size:= 14 ;
Canvas . TextOut( 10 , 10 ,IntToStr(FNum));
end ;
end ;
|
Код:
1 2 3 4 5 | n:=TGraphicControl1 . Create(Form1);
n . Parent:=Form1;
n . Left:=x;
n . Top:=y;
n . Num:= 1 ;
|
вот так вот не хочет работать. число не отрисовается