ArcObjects Library Reference

Get Dockable Window Snippet

Get a DockableWindow by name.

[C#]

///<summary>Get a DockableWindow by name.</summary>
///  
///<param name="application">An IApplication interface.</param>
///<param name="windowName">A System.String that is the UID name of the dockable window to find. Example: "esriGeoprocessingUI.GPCommandWindow"</param>
///   
///<returns>An IDockableWindow interface.</returns>
///  
///<remarks></remarks>
public ESRI.ArcGIS.Framework.IDockableWindow GetDockableWindow(ESRI.ArcGIS.Framework.IApplication application, System.String windowName)
{
  ESRI.ArcGIS.Framework.IDockableWindowManager dockWindowManager = application as ESRI.ArcGIS.Framework.IDockableWindowManager;
  ESRI.ArcGIS.esriSystem.UID windowID = new ESRI.ArcGIS.esriSystem.UIDClass();
  windowID.Value = windowName; // example: "esriGeoprocessingUI.GPCommandWindow"
  return dockWindowManager.GetDockableWindow(windowID);
}
[Visual Basic .NET]

'''<summary>Get a DockableWindow by name.</summary>
'''  
'''<param name="application">An IApplication interface.</param>
'''<param name="windowName">A System.String that is the UID name of the dockable window to find. Example: "esriGeoprocessingUI.GPCommandWindow"</param>
'''   
'''<returns>An IDockableWindow interface.</returns>
'''  
'''<remarks></remarks>
Public Function GetDockableWindow(ByVal application As ESRI.ArcGIS.Framework.IApplication, ByVal windowName As System.String) As ESRI.ArcGIS.Framework.IDockableWindow

  Dim dockWindowManager As ESRI.ArcGIS.Framework.IDockableWindowManager = CType(application, ESRI.ArcGIS.Framework.IDockableWindowManager)
  Dim windowID As ESRI.ArcGIS.esriSystem.UID = New ESRI.ArcGIS.esriSystem.UIDClass
  windowID.Value = windowName ' example: "esriGeoprocessingUI.GPCommandWindow"
  Return dockWindowManager.GetDockableWindow(windowID)

End Function


Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Framework
  • ESRI.ArcGIS.System