I have an ArcMap 10.x AddIn in which I've developed a dockable window. Everything works great except that I want the dockable window to be closed when ArcMap first starts. If the user closes ArcMap with my dockable window open, ArcMap remembers its state and opens it again when it is next launched.
The following code works to open or close the dockable window once ArcMap is open:
Dim pUI As ESRI.ArcGIS.esriSystem.IUID = New ESRI.ArcGIS.esriSystem.UID pUI.Value = My.ThisAddIn.IDs.CenterlineDockableWindow Dim docWin As ESRI.ArcGIS.Framework.IDockableWindow = My.ArcMap.DockableWindowManager.GetDockableWindow(pUI) If TypeOf docWin Is ESRI.ArcGIS.Framework.IDockableWindow Then docWin.Show(bVisible) End If
But I have tried calling this code all over the place and I can't get my dockable window to close at the start of an ArcMap session. (Addin extension startup, construction of the dockable window.) Help please!