FollowMouse Property throwing exception.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

FollowMouse Property throwing exception.

Post by Nitin » Thu Sep 16, 2010 8:36 am

Hi,

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;
         }
}
When I comment the line:

Code: Select all

cursorTool1.FollowMouse = true;
ContourTeeChart.Tools.Add(cursorTool1);
Exception is not comming but functionality stopped working.

Could you please check and let me know the issue?

Thanks,
Nitin

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: FollowMouse Property throwing exception.

Post by Sandra » Thu Sep 16, 2010 10:24 am

Hello Nitin,


I couldn't reproduce your problem with attached code. Could you please send us a simple example code we can run as-is to reproduce the problem here?

Thanks in advance.
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply