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?
Mouse cursor over legend does not change
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mike,
Yes, you can use legend's clicked method and MouseMove event like this:
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 |
Instructions - How to post in this forum |
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
Example code does not accomplish my requirement
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.
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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.
Ok, I've added this to our wish-list to be considered for inclusion in future releases.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.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |