Mouse cursor over legend does not change

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mike Jones
Advanced
Posts: 192
Joined: Thu Feb 01, 2007 12:00 am
Contact:

Mouse cursor over legend does not change

Post by Mike Jones » Fri Aug 17, 2007 11:25 pm

When interacting with a chart, I set the TeeChart.Cursor to something other than the Default mouse cursor. I found that if I move the mouse over the chart legend the mouse cursor remains the same. I would like it to go back to Default. I found the legend does not provide any properties, events, or methods to minipulate the mouse cursor. It appears to be by design.

Is there any way to change the mouse cursor while it is over the legend the return the mouse cursor back when the mouse leaves the legend?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Aug 20, 2007 9:27 am

Hi Mike,

Yes, you can use legend's clicked method and MouseMove event like this:

Code: Select all

		private void tChart1_MouseMove(object sender, MouseEventArgs e)
		{
			if (tChart1.Legend.Clicked(e.X,e.Y) != -1)
			{
				tChart1.Cursor = Cursors.Cross;
			}
			else
			{
				tChart1.Cursor = Cursors.Default;
			}
		}
Best Regards,
Narcís Calvet / 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

Mike Jones
Advanced
Posts: 192
Joined: Thu Feb 01, 2007 12:00 am
Contact:

Example code does not accomplish my requirement

Post by Mike Jones » Mon Aug 20, 2007 3:40 pm

The example you provided works fine if I want the cursor to change only if I click the left mouse button. I want to change the cursor anytime the mouse is hovering within the bounds of the legend.

Ideally I would like the mouse cursor to be set to Cursors.Default while it is within the bound of the legend. Upon leaving the bounds of the legend, the mouse cursor changes to what it was when over the chart's graphing area.

I guess I can make the necessary calculations to simulate this, it would be a nice feature if the legend was like a control and would control the mouse events like standard winform controls.

If you don't mind adding this to a list of requested features for future products.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Aug 20, 2007 3:48 pm

Hi Mike,

The example above works as you request for me. Are you using the same event as in the example? The MouseMove event should work even without pressing any mouse button.
I guess I can make the necessary calculations to simulate this, it would be a nice feature if the legend was like a control and would control the mouse events like standard winform controls.
Ok, I've added this to our wish-list to be considered for inclusion in future releases.
Best Regards,
Narcís Calvet / 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