写了一个继承自TMemo的类TTestMemo
type
TTestMemo=class(TMemo)
private
FCanvas: TCanvas;
public
Constructor Create(AOwner: TComponent);
Destructor Destroy;override;
published
Canvas: TCanvas read FCanvas;
end;
然后在主程序单元中,动态创建了一个TTestMemo的对象,在它的canvas上画
为何提示"not allow drawing"错误?
type
TTestMemo=class(TMemo)
private
FCanvas: TCanvas;
public
Constructor Create(AOwner: TComponent);
Destructor Destroy;override;
published
Canvas: TCanvas read FCanvas;
end;
然后在主程序单元中,动态创建了一个TTestMemo的对象,在它的canvas上画
为何提示"not allow drawing"错误?
没有的话,不能画图的。
另外,to cocoboy79:这个Canvas是不需要Write的访问的。
property Canvas: TCanvas read FCanvas;
TTestMemo=class(TMemo)
public
Canvas: TCanvas read FCanvas;
end;
TTestMemo=class(TMemo)
public
property Canvas;
end;