ArcObjects Library Reference

Resize Dockable Window Snippet

Resize a floating dockable window.

[C#]

///<summary>Resize a floating dockable window.</summary>
///  
///<param name="dockableWindow">An IDockableWindow interface.</param>
///<param name="width">A System.Int32 that is how much to increase the width of the dockable window. Less that 1 shrinks the window, 1 leaves the window the same size, greater that 1 makes it bigger. Example: 2</param>
///<param name="height">A System.Int32 that is how much to increase the height of the dockable window. Less that 1 shrinks the window, 1 leaves the window the same size, greater that 1 makes it bigger. Example: 2</param>
///   
///<remarks></remarks>
public void ResizeDockableWindow(ESRI.ArcGIS.Framework.IDockableWindow dockableWindow, System.Int32 width, System.Int32 height)
{
  ESRI.ArcGIS.Framework.IWindowPosition windowPos = dockableWindow as ESRI.ArcGIS.Framework.IWindowPosition;
  if (windowPos.State == ESRI.ArcGIS.Framework.esriWindowState.esriWSFloating)
  {
    windowPos.Move(0, 0, windowPos.Width * width, windowPos.Height * height);
  }
}
[Visual Basic .NET]

'''<summary>Resize a floating dockable window.</summary>
'''  
'''<param name="dockableWindow">An IDockableWindow interface.</param>
'''<param name="width">A System.Int32 that is how much to increase the width of the dockable window. Less that 1 shrinks the window, 1 leaves the window the same size, greater that 1 makes it bigger. Example: 2</param>
'''<param name="height">A System.Int32 that is how much to increase the height of the dockable window. Less that 1 shrinks the window, 1 leaves the window the same size, greater that 1 makes it bigger. Example: 2</param>
'''   
'''<remarks></remarks>
Public Sub ResizeDockableWindow(ByVal dockableWindow As ESRI.ArcGIS.Framework.IDockableWindow, ByVal width As System.Int32, ByVal height As System.Int32)

  Dim windowPos As ESRI.ArcGIS.Framework.IWindowPosition = CType(dockableWindow, ESRI.ArcGIS.Framework.IWindowPosition)

  If windowPos.State = ESRI.ArcGIS.Framework.esriWindowState.esriWSFloating Then
    windowPos.Move(0, 0, windowPos.Width * width, windowPos.Height * height)
  End If

End Sub


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