Chart Event Handlers die when Selector tool is attached
Posted: Mon Jun 15, 2009 3:10 am
I have an issue when selector tool is added to the chart. None of the even handlers fireup when selector tool is added to the chart.
Please see the following code where I have a chart.mousemove event for example. When you run the following code mousemove event never gets fired. When you comment out the selector tool related code, all the events fireup correctly.
Please suggest a solution.
Thanks
Please see the following code where I have a chart.mousemove event for example. When you run the following code mousemove event never gets fired. When you comment out the selector tool related code, all the events fireup correctly.
Please suggest a solution.
Thanks
Code: Select all
Public Class Form1
Private WithEvents myChart As New Steema.TeeChart.TChart
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For a As Integer = 0 To 9
myChart = New Steema.TeeChart.TChart
Dim cursortool1 As New Steema.TeeChart.Tools.CursorTool(myChart.Chart)
Dim series1 As New Steema.TeeChart.Styles.FastLine(myChart.Chart)
Dim ColorLine1 As New Steema.TeeChart.Tools.ColorLine(myChart.Chart)
Dim AxisArrowBottom As New Steema.TeeChart.Tools.AxisArrow(myChart.Chart)
Dim MarksTip1 As New Steema.TeeChart.Tools.MarksTip(myChart.Chart)
myChart.Dock = DockStyle.Top
AddHandler myChart.MouseMove, AddressOf MyChart_MouseMove
cursortool1.FollowMouse = True
cursortool1.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical
'Comment the following three lines to see the mousemove event
Dim selector1 As New Steema.TeeChart.Tools.Selector(myChart.Chart)
selector1.AllowDrag = True
selector1.AllowResizeChart = True
series1.FillSampleValues(1800)
ColorLine1.AllowDrag = False
ColorLine1.Pen.Width = 1
ColorLine1.Axis = myChart.Axes.Left
ColorLine1.Pen.Color = Color.Black
ColorLine1.Value = 0
Dim AxisArrowLeft As New Steema.TeeChart.Tools.AxisArrow(myChart.Chart)
AxisArrowLeft.Active = True
AxisArrowLeft.Axis = myChart.Axes.Left
AxisArrowBottom.Active = True
AxisArrowBottom.Axis = myChart.Axes.Bottom
MarksTip1.Active = True
MarksTip1.MouseDelay = 30
MarksTip1.HideDelay = 10000 ' 10 seconds display
MarksTip1.MouseAction = Steema.TeeChart.Tools.MarksTipMouseAction.Move
MarksTip1.Style = Steema.TeeChart.Styles.MarksStyles.XY
Me.Controls.Add(myChart)
Next
End Sub
Private Sub myChart_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Me.Text = e.Location.ToString
End Sub
End Class