I am having trouble clearing drawline handles after deleting a selected line.
For example:
DrawLine1.Lines.Remove(DrawLine1.Lines.Item(NumLine))
Tchart1.Redraw
This will delete the line but leaves the drawline handles on the canvas, if the line has been selected.
Is there another way to clear the line and handles?
Can I clear all selections before deleting the line?
Drawline.DeleteSelected() is not suitable for my purpose, as the line I want to delete is not always the selected line.
Is this a bug?
Clearing Drawline Handles after Delete
Re: Clearing Drawline Handles after Delete
Hello lilo,
I inform you I have added your problem with Remove DrawLine, in the bug list report with number[TF02016242]. We will try to fix it upcoming maintenance releases. On the other hand, I think you can use DeleteSelected() as a workaround as do in next lines of code:
Can you tell us if previous code works as you expected?
Thanks,
I inform you I have added your problem with Remove DrawLine, in the bug list report with number[TF02016242]. We will try to fix it upcoming maintenance releases. On the other hand, I think you can use DeleteSelected() as a workaround as do in next lines of code:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Line Series1;
Steema.TeeChart.Tools.DrawLine drawLine1;
private void InitializeChart()
{ //InitializeChart
tChart1.Aspect.View3D = false;
//Series
Series1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
this.Series1.FillSampleValues();
//Tool
drawLine1 = new DrawLine(tChart1.Chart);
}
private void button1_Click(object sender, EventArgs e)
{
Boolean [] deletLine = new Boolean[drawLine1.Lines.Count];
for (int i = 0; i < drawLine1.Lines.Count; i++)
{
if (i % 3 == 0)
{
deletLine[i] = true;
}
else
{
deletLine[i] = false;
}
}
//Tool
Steema.TeeChart.Tools.DrawLineItem drawlineItem1 = drawLine1.Lines[0];
//Save DrawLineItem;
drawLine1.Selected = drawlineItem1;
for (int i = 0; i < drawLine1.Lines.Count; i++ )
{
Steema.TeeChart.Tools.DrawLineItem I = drawLine1.Lines[i];
if (deletLine[i])
{
if (I != drawlineItem1)
{
drawLine1.Selected = I;
drawLine1.DeleteSelected();
}
else { drawLine1.DeleteSelected(); }
}
}
}
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Clearing Drawline Handles after Delete
Thanks Sandra,
Your workaround contains some clues how to fix the problem. Now working fine.
Your workaround contains some clues how to fix the problem. Now working fine.
Re: Clearing Drawline Handles after Delete
Hello lilo,
I am glad that my solution helps you.
Thanks,
I am glad that my solution helps you.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Clearing Drawline Handles after Delete
Hello lilo,
I inform you that the bug number [TF02016242] isn't a bug, because you can solve the problem with the handles, setting the DrawLine.Selected to null as do in next code:
I hope will helps.
Thanks,
I inform you that the bug number [TF02016242] isn't a bug, because you can solve the problem with the handles, setting the DrawLine.Selected to null as do in next code:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Line Series1;
Steema.TeeChart.Tools.DrawLine drawLine1;
private void InitializeChart()
{ //InitializeChart
tChart1.Aspect.View3D = false;
//Series
Series1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
this.Series1.FillSampleValues();
//Tool
drawLine1 = new Steema.TeeChart.Tools.DrawLine(tChart1.Chart);
}
private void button1_Click(object sender, EventArgs e)
{
if (drawLine1.Lines.Count != 0)
{
if (drawLine1.Lines.Count > 1)
{
Steema.TeeChart.Tools.DrawLineItem I = drawLine1.Selected;
drawLine1.Lines.Remove(I);
drawLine1.Selected = null;
}
else
{
drawLine1.Lines.Remove(drawLine1.Lines[0]);
}
}
}
Thanks,
Best Regards,
Sandra Pazos / 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 |