This document is archived and information here might be outdated. Recommended version. |
DockableWindow object.
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 (esriSystem) | |
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 code shows how you can use the Move method on IWindowPosition to size and position the TOC.
public void MoveTOC(IApplication app)
{
IDockableWindowManager docWinMgr=app as IDockableWindowManager; 'cast
UID tocID=new UIDClass();
tocID.Value="{368131A0-F15F-11D3-A67E-0008C7DF97B9}";
IDockableWindow theTOC=docWinMgr.GetDockableWindow(tocID);
IWindowPosition winPos=theTOC as IWindowPosition; 'cast
if (theTOC.IsVisible())
{
theTOC.Dock(esriDockFlags.esriDockFloat);
winPos.Move(10, 10, 150, 300);
}
}
The following code shows how you can use the Move method on IWindowPosition to size and position the TOC.
Public Sub MoveTOC(app As IApplication)
Dim docWinMgr As IDockableWindowManager
Dim theTOC As IDockableWindow
Dim winPos As IWindowPosition
docWinMgr=CType(app, IDockableWindowManager) 'cast
Dim tocID As UID=New UIDClass
tocID.Value="{368131A0-F15F-11D3-A67E-0008C7DF97B9}"
theTOC=docWinMgr.GetDockableWindow(tocID)
winPos=CType(theTOC, IWindowPosition) 'cast
If theTOC.IsVisible() Then
theTOC.Dock(esriDockFlags.esriDockFloat)
winPos.Move(10, 10, 150, 300)
End If
End Sub