Since we upgraded from a previous version of TeeChart to the new release, some of our code is not working anymore.
Indeed, we created some events in our code that allow to show an annotation when the user clicks on a point.
Here is the used code we use to handle the event:
Code: Select all
Dim pt As Steema.TeeChart.Styles.Points
pt = New Steema.TeeChart.Styles.Points(TChartScatter.Chart)
pt.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
pt.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
AddHandler pt.DblClick, AddressOf pt_DblClick
Code: Select all
Private Sub pt_DblClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
For Each ann As Steema.TeeChart.Tools.Tool In TChartScatter.Tools
If ann.GetType Is GetType(Steema.TeeChart.Tools.Annotation) Then
Dim tmpAnn As Steema.TeeChart.Tools.Annotation = ann
If tmpAnn.Active And tmpAnn.Left = 6 And tmpAnn.Top = 8 Then
MsgBox("Please first move the annotation that appear in the top left corner", MsgBoxStyle.Information, "EMIS V2")
Exit Sub
End If
End If
Next
Dim newAnnotation As Steema.TeeChart.Tools.Annotation
newAnnotation = New Steema.TeeChart.Tools.Annotation(TChartScatter.Chart)
TChartScatter.Tools.Add(newAnnotation)
newAnnotation.Active = False
newAnnotation.Cursor = System.Windows.Forms.Cursors.Default
newAnnotation.Height = 17
newAnnotation.Shape.Font.Shadow.Visible = False
newAnnotation.Width = 9
Dim tmpPoint As Steema.TeeChart.Styles.Points = CType(sender, Steema.TeeChart.Styles.Points)
Dim index = tmpPoint.Clicked(e.X, e.Y)
newAnnotation.Text = tmpPoint.Item(index).Label()
newAnnotation.Callout.XPosition = tmpPoint.CalcXPos(index)
newAnnotation.Callout.YPosition = tmpPoint.CalcYPos(index)
If tmpPoint.Item(index).Color.Equals(System.Drawing.Color.White) Then
newAnnotation.Callout.Arrow.Color = System.Drawing.Color.Black
Else
newAnnotation.Callout.Arrow.Color = tmpPoint.Item(index).Color
End If
newAnnotation.Callout.Arrow.Width = 2
newAnnotation.Callout.Arrow.Visible = True
newAnnotation.Cursor = System.Windows.Forms.Cursors.SizeAll
newAnnotation.Shape.Shadow.Visible = False
newAnnotation.Active = True
_dicAnnotation.Add(TChartScatter.Tools.Count - 1, index)
AddHandler newAnnotation.Click, AddressOf newAnnotation_Click
End Sub
The Question is: Why isn't it working anymore??? How to make it work again???
This matter is urgent because some of our customer are complaining about it.
Thanks in advance.