Hi,
I need to customize the zoom feature of the xamdatachart.The zoom with the mouse-wheel should behave as following:
- only horizontally as default
- only vertically when Control-Key is pressed down.
I tried to react to KeyDown, KeyUp and MouseLeaveFocus Events in order to set the VerticalZoomable and HorizontalZoomable Properties but the KeyDown and KeyUp events are never triggered. Neither are PreviewKeyDown and PreviewKeyUp. So I really don't now how to achieve this behavior.
need help,
Thank you in advance,
Jerome RG
Hi Jerome,
I'm looking into this for you and will post back here when I have more information
You mentioned that you were looking for events. You should be able to trap the PreviewKeyUp and the PreviewKeyDown events.
Adding this line of codeup to the += and then tabbing will generate the new event handle as a stub that you can use. And will generate the right arguments in the event handlers, if that is an issue.
xmDataChart.PreviewMouseWheel += new MouseWheelEventHandler(xmDataChart_PreviewMouseWheel);
I was able to achieve what I think you need by controlling the chart’s HorizontalZoomable and VerticalZoomable properties depending on what key had be pressed or released, using the PreviewKeyUp and PreviewKeyDown events.
If you continue to have issue, it would be helpful if you could attach a small sample.