I am trying to create/delete TAnnotationTool at runtime so I can show text messages base on user choice.
I am able to create them at run time, but I am running in to few issues.
1- I can create them and add them to the tools list of the TChart object, but I am unable to delete them. I always get an invalid pointer error.
Is possible to create/delete the annotation at runtime?
Using TAnnotationTool at runtime
Re: Using TAnnotationTool at runtime
Hello,
This seems to work fine for me without problems:
This seems to work fine for me without problems:
Code: Select all
uses TeeTools;
procedure TForm1.Button1Click(Sender: TObject);
begin
TAnnotationTool(Chart1.Tools.Add(TAnnotationTool)).Text:='Annotation';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if (Chart1.Tools.Count>0) and (Chart1.Tools[0] is TAnnotationTool) then
begin
Chart1.Tools.Delete(0);
Chart1.Draw;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |