I found a method for casting the AddIn DockableWindow to an IDockableWindow as shown below. I want to ensure the width is at least 240 pixels and the code below works for the Floating state. However, nothing I have tried works for any of the docked states. Any ideas on how to stop a docked window from getting too narrow? Public Function GetAddInDockWindow(ByVal application As ESRI.ArcGIS.Framework.IApplication) 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 = My.ThisAddIn.IDs.DockWindow
Return dockWindowManager.GetDockableWindow(windowID)
End Function
Private Sub DockWindow_Layout(ByVal sender As Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles Me.Layout
Dim dockableWindow As ESRI.ArcGIS.Framework.IDockableWindow
dockableWindow = GetAddInDockWindow(CType(m_hook, ESRI.ArcGIS.Framework.IApplication))
Dim windowPos As ESRI.ArcGIS.Framework.IWindowPosition = CType(dockableWindow, ESRI.ArcGIS.Framework.IWindowPosition)
If windowPos.State = ESRI.ArcGIS.Framework.esriWindowState.esriWSFloating And windowPos.Width < 240 Then
windowPos.Move(windowPos.Left, windowPos.Top, 240, windowPos.Height) ' works
ElseIf windowPos.Width < 240 Then
windowPos.Width = 240 ' doesn't work nor does Move for docked windows
End If
End Sub