I am using Teechart dll version 4.0.2009.62332, and having issue with the property FollowMouse.
In our application we have provided an option Show Cursor Line) with which user can see cursor lines when he moves his mouse over the chart. In the earlier version of TeeChart i.e. 4.0.2009.35592 is working fine. However in the Teechart version 4.0.2009.62332 when the user select the option (Show Cursor Line) to see cursor line, application is throwing unhandeled exception.
The exception Text is:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Tools.CursorTool.OnChange(Int32 snapPoint)
at Steema.TeeChart.Tools.CursorTool.MouseMove(MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Tools.CursorTool.MouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Keys modKeys, Cursor& c)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Code we are using is as follows.
Code: Select all
protected void showCursorLinesMenuItem_Click(System.Object sender, System.EventArgs e)
{
logger.Debug("Inside showCursorLinesMenuItem_Click");
if(context != null) context.SetInCallContext();
if(CMMenuItem_ShowCursorLines.Checked)
{
ContourTeeChart.Tools.Remove(cursorTool1);
CMMenuItem_ShowCursorLines.Checked=false;
}
else
{
cursorTool1.FollowMouse = true;
ContourTeeChart.Tools.Add(cursorTool1);
CMMenuItem_ShowCursorLines.Checked=true;
}
}
Code: Select all
cursorTool1.FollowMouse = true;
ContourTeeChart.Tools.Add(cursorTool1);
Could you please check and let me know the issue?
Thanks,
Nitin