how to disable/enable the zoom in/out function when scrolling mouse wheel

2312
5
04-11-2011 07:15 AM
ThaoNguyen
New Contributor II
When I scroll mouse wheel, map is zoomed in or out.  This is a nice feature.
In our application, there are cases that I want this behavior to be active or inactive.
For instance, I add a map into a "tab view".  If the tab view is NOT active, and I scroll the mouse wheel, I do not want the map to be zoomed in or out.
If the tab view is active, I want the map to be zoomed in/out when I scroll the mouse wheel.

How can I do this?

Thanks!
0 Kudos
5 Replies
ThaoNguyen
New Contributor II
When I scroll mouse wheel, map is zoomed in or out.  This is a nice feature.
In our application, there are cases that I want this behavior to be active or inactive.
For instance, I add a map into a "tab view".  If the tab view is NOT active, and I scroll the mouse wheel, I do not want the map to be zoomed in or out.
If the tab view is active, I want the map to be zoomed in/out when I scroll the mouse wheel.

How can I do this?

Thanks!


To be clear, how can I disable or enable the Arcgis built-in mouse wheel function?
Please let me know if it is doable or not.  Thanks!
0 Kudos
DominiqueBroux
Esri Frequent Contributor
If you want to stop any interaction with your map when the tab view is not active, you can set to false the IsHitTestVisible property of your map.

Just my 2cts, there is probably more subtil solutions:o
0 Kudos
ThaoNguyen
New Contributor II
If you want to stop any interaction with your map when the tab view is not active, you can set to false the IsHitTestVisible property of your map.

Just my 2cts, there is probably more subtil solutions:o


This does not work well 😞 because my app has a scrollviewer, when setting isHitTestVisible to false, scrolling the mouse wheel while the cursor is on the map does not scroll the window vertical bar and I want it worked as before, only the map zooming function is disabled.
In addition, I think the map was still set focused or something.  That is why I ask if there is a way to disable this.
Thanks!
0 Kudos
JenniferNery
Esri Regular Contributor
0 Kudos
ThaoNguyen
New Contributor II
I think this is related thread: http://forums.arcgis.com/threads/19079-Disabling-Map-Mouse-Events


I handled this by setting e.Handled = true in PreviewMouseWheel handler method.  That works but I have to give up in making my scroll viewer worked when the cursor is inside the map.
0 Kudos