There are two approaches to panning - TrackPan and the PanStart, PanMoveTo,
and PanStop group. TrackPan is the easiest to use as it takes care of all the mouse
events, performs the pan, and refreshes the display when the pan is complete.
See the Pan Tool tip for another pan sample that uses the
PanStart approach. This sample also shows how to make a pan tool that works in all
views and magnifier windows and works almost identically to ArcMap's pan tool.
How to use:
- Add a UIToolControl to any toolbar.
- Right-click on the tool and select view source.
- Paste the code below into VBA. Make sure the names of the UIControls matches.
- Close VBA to enable mouse events.
- Use the command to pan the focus map.
Private Sub UIToolControl1_MouseDown(
Set pMxDoc = Application.Document
Set pActiveView = pMxDoc.FocusMap
Set pScreenDisplay = pActiveView.ScreenDisplay