Switch between pan and zoom programmatically

masty
09-20-2006, 05:24 AM
I'm developing an application which uses MapPoint activex control.
I don't want any toolbars in the mappoint control so I've disabled them, anyway when I'm over the control with the mouse I would like to pan at the same way I do when I select the Pan instrument in the Navigation Toolbar. I would like also to use the function zoom area as I can do when the zoom instrument in the navigation toolbar is selected. I should switch between these two functionality (zoom and pan) through buttons which are outside of the MapPoint control... so the question is..
can I switch programmatically between the PAN instrument and the ZOOM instrument?

Thanks in advance for anyone can give me help.
masty

jlewis
09-20-2006, 09:49 AM
Hi masty,

You can use the DragBehavior property to switch between pan and zoom.

So, assuming your control is called mapCtl use

mapCtl.ActiveMap.DragBehavior = MapPoint.GeoDragBehavior.geoDragHand (for pan)

and

mapCtl.ActiveMap.DragBehavior = MapPoint.GeoDragBehavior.geoDragBox (for zoom)

Hope this helps...

masty
09-21-2006, 12:42 PM
OK! It works perfectly.

Thanks a lot jlewis!

bye!

 
Web mp2kmag.com
mapforums.com