How can I disable the double-click (which causes a zoom in) and the MouseWheel (causes zoom in/out) functionality from happening? I need to tightly control how the map reacts to different inputs.
Thanx,
Rob
How can I disable the double-click (which causes a zoom in) and the MouseWheel (causes zoom in/out) functionality from happening? I need to tightly control how the map reacts to different inputs.
Thanx,
Rob
Robert,
You need to work with the ExtentOverlay of the map for controling that type of behavior. See the code below:
//Disables zooming in when left double clicking.
winformsMap1.ExtentOverlay.DoubleLeftClickMode = MapDoubleLeftClickMode.Disabled;
//Disables zooming out when right double clicking.
winformsMap1.ExtentOverlay.DoubleRightClickMode = MapDoubleRightClickMode.Disabled;
//Disables zooming in and out at mousewheel.
winformsMap1.ExtentOverlay.MouseWheelMode = MapMouseWheelMode.Disabled;
Robert,
I want to also add that you will find a large number of properties such as ExtentChangedType or ZoomPercentage to give you a lot of control on how the map extent should react at user interaction. There are also events such as MapMouseWheel or MapMouseDoubleClick etc to keep track of how the user is interacting with the map.
Hi,val
Could you tell me which event that these code shoud be. I put them in page_load event, but it does not work.
thanks
Hello Eric,
You did right, it should be in the page_load, could you please provide some of your code or sample that I can check for you?
Regards,
Gary
Hello Gary,
Thanks for your response,it’s ok now.I made some mistakes in my code.
Thanks a lot.
Eric
Hello Eric,
You are welcome, please feel free to let us know your problem.
Regards,
Gary