I am listening to ClickPointer pointer event of the line series.
The thing is this event gets fired when clicked with left mouse button as well as right mouse button,
So how do I find out whether the mouse button pressed was left or right?
I tried using click event of series to identify the mouse button (by keeping a boolean to indicate if the left mouse button was pressed).
But the problem is when the user clicks on the exact point (pointer) directly ClickPointer event is fired (Click event is not fired) and hence I am unable to identify the mouse button pressed.
Any ideas on how to achieve this?
Thanks
How to identifty the mouse button in ClickPointer event?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lakshmi,
You can get the mouse button clicked using TeeChart's MouseDown event an some code like this:
You can get the mouse button clicked using TeeChart's MouseDown event an some code like this:
Code: Select all
private void line1_ClickPointer(Steema.TeeChart.Styles.CustomPoint series, int valueIndex, int x, int y)
{
if (mb==MouseButtons.Left)
{
//Put your code here.
}
}
private MouseButtons mb;
private void tChart1_MouseDown(object sender, MouseEventArgs e)
{
mb = e.Button;
}
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 |
How to identifty the mouse button in ClickPointer event?
Thanks Narcis,
Instead I coded something like below:
if (TChart.MouseButtons == MouseButtons.Left)
{
...code goes here
}
Let me know your comments on the same.
One more question:
If I only subscribe for line.ClickPointer event, on clicking of the pointer on the line my code (function) does not get called.
But along with ClickPointer event, if I subscribe also for line.Click event (just provide a empty function to listen to this event), only then the clickpointer code of mine gets called.
Any comments on this behaviour?
Thanks.
Instead I coded something like below:
if (TChart.MouseButtons == MouseButtons.Left)
{
...code goes here
}
Let me know your comments on the same.
One more question:
If I only subscribe for line.ClickPointer event, on clicking of the pointer on the line my code (function) does not get called.
But along with ClickPointer event, if I subscribe also for line.Click event (just provide a empty function to listen to this event), only then the clickpointer code of mine gets called.
Any comments on this behaviour?
Thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lakshmi,
Yes, that's right and this is as designed as ClickPointer event depends on the series Click event.
Yes, that's right and this is as designed as ClickPointer event depends on the series Click event.
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 |