hi,
searched the forum, found this http://www.teechart.net/support/viewtopic.php?t=3552 .
So very happy to try TDrawLine->Destroy(), but the error is that DrawLine doesn't have Destroy() method.
How do I delete lines then.
Fang
How do I delete lines from TDrawLineTool
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Fang,
Please read the topic you pointed carefully. You need to use:
Please read the topic you pointed carefully. You need to use:
Code: Select all
ChartTool1->Lines[0]->Destroy();
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
for whatever reason, it just doesn't work.
it says Destroy is not a member of TDrawLine. HELP
Code: Select all
TDrawLine* dl=(TDrawLine*)DrawLineTool->Lines->Items[0];
dl->Destroy();
or
(*DrawLineTool->Lines)[0]->Destroy();
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Fang,
Try using something like this:
Try using something like this:
Code: Select all
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int i=0; i<ChartTool1->Lines->Count;i++)
{
ChartTool1->Lines->Delete(i);
}
Chart1->Refresh();
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
First of all, the above code probably should write like this
But anyway, I tried both, none of them works (No error either).
Code: Select all
while (DrawLineTool->Lines->Count>0) {
DrawLineTool->Lines->Delete(0);
}
Hi Fang,
I've just tried with the following code and works fine (BDS2006 and TC7.07) :
Could you please check if it works fine for you ? If you still having problems let me know and I'll send to you a simple app. to verify.
I've just tried with the following code and works fine (BDS2006 and TC7.07) :
Code: Select all
void __fastcall TForm1::Button1Click(TObject *Sender)
{
while (ChartTool1->Lines->Count >0) {
ChartTool1->Lines->Delete(0);
}
ChartTool1->Repaint();
ShowMessage(IntToStr(ChartTool1->Lines->Count));
}
Pep Jorge
http://support.steema.com
http://support.steema.com