DockableWindow object.
DockableWindow is a non-creatable object. References to non-creatable objects must be obtained through other objects.
A DockableWindow is an auxillary window that can display data. This window is treated as a modeless child window of that application. It can exist in a floating state or attached to the main application window.
The Table of Contents in ArcMap is a dockable window.
Use the IDockableWindowManager interface to get access to a particular dockable window. You can implement the IDockableWindowDef interface to create a custom dockable window.
Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.
| Interfaces | Description |
|---|---|
| IDockableWindow | Provides access to members that define and control a dockable window. |
| ISupportErrorInfo | Indicates whether a specific interface can return Automation error objects. |
| IWindowPosition | Provides access to members that query or modify a window's position, size and state. |
The DockableWindow class also implements the IWindowPosition interface. You can use this interface to size and position your dockable window. Note, the dockable window must be in a floating state before you call any of the properties or methods on IWindowPosition.
The following VBA code shows how you can use the Move method on IWindowPosition to size and position the TOC.
Public Sub MoveTOC()
Dim pDocWinMgr As IDockableWindowManager
Dim pTOC As IDockableWindow
Dim pWinPos As IWindowPosition
Set pDocWinMgr = Application 'QI
Set pTOC = pDocWinMgr.GetDockableWindow(arcid.TableofContents)
Set pWinPos = pTOC 'QI
If pTOC.IsVisible Then
pTOC.Dock esriDockFloat
pWinPos.Move 10, 10, 150, 300
End If
End Sub