Dockable Windows

Last Modified:1/24/2002

This sample provides an MXD file preview dockable window. Its implements a command that displays a dockable window containing a MapControl and a file selection option. On selecting an MXD file, the MapControl is updated to display the contents of the file.

How to use:
  1. Register this sample's dll by compiling the sample or by using Regsvr32.exe.
  2. If using the Visual Basic sample use the Categories.exe program or the ESRI Compile and Register Add-in, to add the clsPreviewCommand to the 'ESRI Mx Commands' category and the clsPreviewWindow to the 'ESRI Mx Dockable Windows' category. This will happen automatically if you are using the Visual CPP sample.
  3. Close and re-start ArcMap.
  4. Under the Customize dialog, select the Commands tab. Select either the Map Preview VB or Map Preview VCPP from the Developer Samples category and drag it on to a toolbar.
  5. Click on the command and the dockable window will be displayed. Click the "..." button and select an MXD file. The content of the file will be displayed at its full extent in the file.


Requires: An MXD file.

Minimum ArcGIS Version Required: 8.2

Difficulty: Intermediate

Visual Basic Visual C++
File Description
DockableWindow.vbp Visual Basic project file for the sample.
frmPreviewWindow.frm Form containing the controls and preview display.
clsPreviewCommand.cls Class containing the code for the command the toggles the Preview window on and off.
clsPreviewWindow.cls Class containing the code that implements the IDockableWindowDef interface.

Key CoClasses: DockableWindow
Key Interfaces: IDockableWindow, IDockableWindowDef, IDockableWindowManager, IMapControl2
Key Members: IDockableWindow.IsVisible, IDockableWindow.Show, IDockableWindowManager.GetDockableWindow, IMapControl.LoadMxFile