This document is archived and information here might be outdated.  Recommended version.


IDockableWindow Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Framework)  

IDockableWindow Interface

Provides access to members that define and control a dockable window.

Product Availability

Available with ArcGIS Desktop.

Description

A dockable window is a window that can exist in a floating state or be attached to the main application window. The Table of Contents in ArcMap and the Tree View in ArcCatalog are examples of dockable windows.

When To Use

The IDockableWindow interface is used to query the properties of a dockable window such as the Caption, Name, and ID. This interface also has methods to return whether the window is currently visible, to display the window, and to dock the window in a particular location on the application.

Use the IDockableWindowManager::GetDockableWindow method to get a reference to a particular dockable window.

Members

Description
Read/write property Caption The caption of the dockable window.
Method Dock Docks or undocks this docking window.
Read-only property ID The unique id for this dockable window.
Method IsVisible Indicates if this docking window is visible.
Read-only property Name The name of the dockable window.
Method Show Hides or shows the dockable window.
Read-only property UserData User defined data.

CoClasses that implement IDockableWindow

CoClasses and Classes Description
DockableWindow DockableWindow object.

Remarks

The following code finds the ArcMap Table of Contents dockable window and, if it's currently visible, the TOC is docked on the right side of the application. You would get m_app from the hook in ICommand::OnCreate().

[C#]
IDockableWindowManager pDocWinMgr=m_app as IDockableWindowManager;
UID uid=new UIDClass();
uid.Value="{368131A0-F15F-11D3-A67E-0008C7DF97B9}";
IDockableWindow pTOC=pDocWinMgr.GetDockableWindow(uid);
if (pTOC.IsVisible())
  pTOC.Dock(esriDockFlags.esriDockRight);
[Visual Basic .NET]
Dim pDocWinMgr As IDockableWindowManager=TryCast(m_app, IDockableWindowManager)
Dim uid As UID=New UIDClass()
uid.Value="{368131A0-F15F-11D3-A67E-0008C7DF97B9}"
Dim pTOC As IDockableWindow=pDocWinMgr.GetDockableWindow(uid)
If pTOC.IsVisible() Then
 pTOC.Dock(esriDockFlags.esriDockRight)
End If

.NET Snippets

Move Dockable Window | Get Dockable Window | Resize Dockable Window | Report Dockable Window Position

.NET Samples

Curve conversion add-in (Code Files: CurveConversionCmd CurveConversionDockWin) | Implementing a schematic digitizing tool (Code Files: DigitTool) | Edit event listener (Code Files: EditorEventsDialogCommand) | Custom selection extension (Code Files: SelectionExtension ToggleDockWinBtn) | Create a custom selection extension by extending ArcObjects (Code Files: SelectionExtension ToggleDockWinBtn) | Simple logging dockable window with a custom context menu (Code Files: ClearLoggingCommand LoggingDockableWindow LoggingDockableWindowCommand LogLineMultiItemCmd) | Web browser dockable window (Code Files: ESRIWebsitesWindowCommand)