OK、TShapeを使用した後、LinesandTextから「Shape1」をクリーンアップする必要があります。
また、「Shape1」のすべてを「Shape2」にコピーする方法は?
ありがとうB4^o ^
type
TShape = class(ExtCtrls.TShape); //interposer class
TForm1 = class(TForm)
Shape1: TShape;
Shape2: TShape;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
// Draw some text on Shape1 := TShape
Shape1.Canvas.Font.Name :='Arial';// set the font
Shape1.Canvas.Font.Size :=20;//set the size of the font
Shape1.Canvas.Font.Color:=clBlue;//set the color of the text
Shape1.Canvas.TextOut(10,10,'1999');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
// Copy everything from Shape1 to Shape2 (make a duplication)
// How to do it ?
showmessage('copy Shape1 into Shape2');
end;
End.