Interactively pans the screen.
[Visual Basic 6.0]
Sub TrackPan
[Visual Basic .NET]
Public Sub TrackPan ( _
)
[C#] public void TrackPan ( );
[Java] public void trackPan ( ) throws IOException, AutomationException
[C++]
HRESULT TrackPan(
void
);
There are two approaches to panning - this method, and the group PanStart, PanMoveTo, and PanStop. This method is the easiest to use as it takes care of all the mouse events and refreshing the display when pan is complete.
Call this method in the mouse down event and make certain you have a reference to the correct ScreenDisplay object. For example, if you are in layout view and you want to pan just the focus map, do not use the ScreenDisplay object associated with IMxDocument::ActiveView. Instead, get the focus Map via IMxDocument::FocusMap, and then get its ScreenDisplay.
The following VBA code excerpt how to get the ScreenDisplay object associated with the focus map.
Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
Dim pScreenDisplay As IScreenDisplay
Dim pActiveView As IActiveView
Dim pMxDoc As IMxDocument
Set pMxDoc = Application.Document
Set pActiveView = pMxDoc.FocusMap
Set pScreenDisplay = pActiveView.ScreenDisplay
pScreenDisplay.TrackPan
End Sub
IScreenDisplay Interface | IScreenDisplay.PanMoveTo Method | IScreenDisplay.PanStop Method | IScreenDisplay.PanStart Method