This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Move Dockable Window Snippet (ArcObjects .NET 10.4 SDK) |
Move a dockable window to a new position.
///<summary>Move a dockable window to a new position.</summary> /// ///<param name="dockableWindow">An IDockableWindow interface.</param> ///<param name="left">A System.Int32 that is the left position of the dockable window from the left screen edge. Example: 10</param> ///<param name="top">A System.Int32 that is the top position of the dockable window from the top screen edge. Example: 10</param> /// ///<remarks></remarks> public void MoveDockableWindow(ESRI.ArcGIS.Framework.IDockableWindow dockableWindow, System.Int32 left, System.Int32 top) { if (dockableWindow.IsVisible()) { //Must be floating before calling any IWindowPosition members dockableWindow.Dock(ESRI.ArcGIS.Framework.esriDockFlags.esriDockFloat); ESRI.ArcGIS.Framework.IWindowPosition windowPosition=dockableWindow as ESRI.ArcGIS.Framework.IWindowPosition; windowPosition.Move(left, top, windowPosition.Width, windowPosition.Height); } }
'''<summary>Move a dockable window to a new position.</summary> ''' '''<param name="dockableWindow">An IDockableWindow interface.</param> '''<param name="left">A System.Int32 that is the left position of the dockable window from the left screen edge. Example: 10</param> '''<param name="top">A System.Int32 that is the top position of the dockable window from the top screen edge. Example: 10</param> ''' '''<remarks></remarks> Public Sub MoveDockableWindow(ByVal dockableWindow As ESRI.ArcGIS.Framework.IDockableWindow, ByVal left As System.Int32, ByVal top As System.Int32) If dockableWindow.IsVisible Then ' Must be floating before calling any IWindowPosition members dockableWindow.Dock(ESRI.ArcGIS.Framework.esriDockFlags.esriDockFloat) Dim windowPosition As ESRI.ArcGIS.Framework.IWindowPosition=CType(dockableWindow, ESRI.ArcGIS.Framework.IWindowPosition) windowPosition.Move(left, top, windowPosition.Width, windowPosition.Height) End If End Sub