Delete all Tools through Code

TeeChart for ActiveX, COM and ASP
Post Reply
paligap
Newbie
Newbie
Posts: 19
Joined: Tue Feb 24, 2004 5:00 am
Location: Australia

Delete all Tools through Code

Post by paligap » Sat Sep 23, 2006 2:35 am

Hello,

I would like to programatically remove all the tools which have been added to a chart. My current code is;

i = 1
While i <= (.Tools.Count - 1)
.Tools.Delete(i)
i = i +1
Wend

This code appears to work most of the time and then other times it will error, I cannot find the source of the fault. Any advice?

My project creates and formats the chart area and series at runtime through code.

When the user requests a new chart, the chart space is formatted again.

What would be handy is a command which will reset the TChart back to it's original state as it sits on the form in the IDE, does such a command work?

Kind Regards
Anthony

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Sep 25, 2006 8:05 am

Hi Anthony,

Such a method doesn't exist. However it is on our wish-list to be considered for inclusion in future releases. To clear all tools in a chart the easiest way is using Clear method:

Code: Select all

Private Sub Command1_Click()
    TChart1.Tools.Clear
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply