Код:
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;
Код:
n:=TGraphicControl1.Create(Form1);
n.Parent:=Form1;
n.Left:=x;
n.Top:=y;
n.Num:=1;
вот так вот не хочет работать. число не отрисовается