Select to view content in your preferred language

Show a dockable window from a add in button

3287
1
03-05-2010 07:51 AM
MikeMillerGIS
Esri Frequent Contributor
I created a new addin.  In there is a button and a dockable window.  I want the button to toggle the dockable window.

here is the code I am using to get the dockable window.  It crashes on the getDockableWindow.

   Dim dockWinID As UID = New UIDClass()
        dockWinID.Value = "ArcGISCostEstimatingTools_ArcGISProjectCostEstimatingWindow"
        Dim dockWindow As ArcGISProjectCostEstimatingWindow
        dockWindow = My.ArcMap.DockableWindowManager.GetDockableWindow(dockWinID)
        dockWindow.Show()

dockable window from the esriaddinx
<DockableWindows>
        <DockableWindow id="ArcGISCostEstimatingTools_ArcGISProjectCostEstimatingWindow" class="ArcGISProjectCostEstimatingWindow+AddinImpl" caption="ArcGIS Project Cost Estimating Window" image="Images\ArcGISProjectCostEstimatingWindow.png">
          <InitialPlacement height="300" width="600" state="pinned" position="bottom" />
        </DockableWindow>
      </DockableWindows>
0 Kudos
1 Reply
MikeMillerGIS
Esri Frequent Contributor
Figured it out, just a bad translation from c#

UIDClass needs to be UID

        'Get dockable window.
        Dim dockWinID As UID = New UID()
        dockWinID.Value = "ArcGISCostEstimatingTools_ArcGISProjectCostEstimatingWindow"
        Dim dockWindow As DockableWindow
        dockWindow = My.ArcMap.DockableWindowManager.GetDockableWindow(dockWinID)
        dockWindow.Show(True)
0 Kudos