Page 1 of 1

MaxLabelsWidth + error message "Invalid parameter used&

Posted: Mon Dec 19, 2005 7:54 pm
by 9524350
Hi,

I created this simple projet to explain the problem:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TChart1.Aspect.View3D = False
TChart1.Panel.Gradient.Visible = True
TChart1.Header.Text = "TeeChart Multiple Axes"
TChart1.Series.Add(Line1)
For t As Integer = 0 To 10
Line1.Add(Convert.ToDouble(t), Convert.ToDouble(10 + t), Color.Red)
Next

Dim test As Integer = TChart1.Axes.Left.MaxLabelsWidth()
End Sub

When I click on the Button I receive the error message "Invalid parameter used" when the code use the "MaxLabelsWidth" function.
I receive this error not all the time (4/5 times).
Can you tel me what's wrong.

I use Visual Basic Dot Net version 7.1.3088.
The TeeChart dot net version is 2.0.2040.15118

Thanks in advance for your help.

Posted: Tue Dec 20, 2005 12:36 pm
by narcis
Hi ACTL,

Have you tried retrieving this value on TChart's AfterDraw event? Using it as you do it may fail because the axes labels hasn't been drawn yet so that this value hasn't been initialized.

Posted: Tue Dec 20, 2005 12:58 pm
by 9524350
Thank you Nancy.
You are right.

Best regards.