Hi!
When the user clicks the left mouse button inside our ViewXY graph, we want to handle that (e.g. by centering a Band around the click).
We do this by handling MouseClick and it works fine.
We would also like to preserve the zoom functionality. But when the user zooms using press-drag-release, we do NOT want to move the band.
MouseClick still gets called when the mouse button is released and we cannot find out how to determine if this was part of a zoom operation or not?
We tried setting a flag in ViewXY.BeforeZooming and clearing it in ViewXY.Zoomed, but these methods are called after MouseClick.
We are using the Semibindable classes and version 7.2.6 , in case that matters,
Regards,
Niels Harremoës
Detecting and ignoring zoom mouse clicks
Moderator: Queue Moderators
-
- Posts: 555
- Joined: Mon Mar 14, 2016 9:22 am
Re: Detecting and ignoring zoom mouse clicks
Hi Niels,
There is not suitable public event in this case. However, the simplest solution is to save mouse-position during _chart.PreviewMouseLeftButtonDown (in WinForms MouseDown) event and compare that position during MouseClick event. If difference between mouse positions bigger than certain value, when it is Zooming operation and Band's movement should be canceled.
Hope this helps.
All the best.
Kestutis
There is not suitable public event in this case. However, the simplest solution is to save mouse-position during _chart.PreviewMouseLeftButtonDown (in WinForms MouseDown) event and compare that position during MouseClick event. If difference between mouse positions bigger than certain value, when it is Zooming operation and Band's movement should be canceled.
Hope this helps.
All the best.
Kestutis
Re: Detecting and ignoring zoom mouse clicks
Thanks - that solved the problem.