+ Reply to Thread
Results 1 to 6 of 6

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

  1. #1
    Thao Nguyen
    Join Date
    Jun 2010
    Posts
    157
    Points
    0
    Answers Provided
    0


    0

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

    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!

  2. #2
    Thao Nguyen
    Join Date
    Jun 2010
    Posts
    157
    Points
    0
    Answers Provided
    0


    0

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

    Quote Originally Posted by bbthao View Post
    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!

  3. #3
    Dominique BROUX

    Join Date
    Jan 2010
    Posts
    2,409
    Points
    743
    Answers Provided
    130


    0

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

    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
    /Dominique

  4. #4
    Thao Nguyen
    Join Date
    Jun 2010
    Posts
    157
    Points
    0
    Answers Provided
    0


    0

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

    Quote Originally Posted by dbroux View Post
    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
    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!

  5. #5
    Jennifer Nery

    Join Date
    May 2010
    Posts
    2,449
    Points
    289
    Answers Provided
    51


    0

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

    Jennifer Nery
    Software Developer
    ArcGIS API for SL/WPF/WP7

  6. #6
    Thao Nguyen
    Join Date
    Jun 2010
    Posts
    157
    Points
    0
    Answers Provided
    0


    0

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

    Quote Originally Posted by jenniferdnery View Post
    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.
    Last edited by bbthao; 04-26-2011 at 10:40 AM.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts