ArcGIS10 - Add Ins and Dockable Window

10068
15
08-25-2010 02:38 PM
TonyThatcher
New Contributor
Been playing with Add-Ins in 10 using Visual Studio 10 for most of the day.  Interesting stuff.  I seem to be being pushed in this direction with the switch to .NET from VBA, so I'm just diving in. 

I have a few examples of buttons, tools, toolbars, etc. up and running, but what I really need to figure out are the Dockable Windows as part of an Add-In.  The documentation is pretty lean in this area other than saying the are "easy" using the new Add-Ins.  I have a Dockable Window added to my Add In, but I am having a heck of a time figuring out how to get it to display.  I'd like to simply click on a button and have the Dockable Window displayed.  It appears that this window should be able to hold the gammut of .NET controls, so I should be able to migrate a bit of my existing VBA Forms over to these Dockable Windows. 

Can anyone please point me in the right direction or give a sample?

Thanks much!

-Tony
0 Kudos
15 Replies
HenryGomez_Rocha
New Contributor
My pal can you share the complete solution?, my email is samario@gmail.com, I am doing that, but when I press the button the dockable windows it isn´t displayed.  Please help me because I need to use this function.  Thanks in advance.

Henry.-

Here is the code in C#:

       
UID dockWinID = new UIDClass();
dockWinID.Value = ThisAddIn.IDs.DockableWindow1;

// Use GetDockableWindow directly as we want the client IDockableWindow not the internal class
IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
dockWindow.Show(true);
0 Kudos
RichardGwozdz
New Contributor
Here is the code in C#:

       
UID dockWinID = new UIDClass();
dockWinID.Value = ThisAddIn.IDs.DockableWindow1;

// Use GetDockableWindow directly as we want the client IDockableWindow not the internal class
IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
dockWindow.Show(true);



Can't seem to get the above to work:

    public class CAD_Test_01_button : ESRI.ArcGIS.Desktop.AddIns.Button
    {
        public CAD_Test_01_button()
        {
        }

        protected override void OnClick()
        {

            UID dockWinID = new UIDClass();
            dockWinID.Value = ThisAddIn.IDs.DockableWindow1;

            // Use GetDockableWindow directly as we want the client IDockableWindow not the internal class
            IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
            dockWindow.Show(true);

        }

        protected override void OnUpdate()
        {
        }
    }




But I get the errors:

Error: The type or namespace name 'IDockableWindow' could not be found (are you missing a using directive or an assembly reference?)

Error: The name 'ArcMap' does not exist in the current context

What references could I be missing?

Thx,

Rich
0 Kudos
JoseSanchez
Occasional Contributor III
I am having the same problem and I am using VB 2008 and ArcGIS 10
0 Kudos
DubravkoAntonic
New Contributor III
Guys get use to it to use SDK help, it it a great source of answers. For this problem with dockable window you have complete solutions already done in SDK samples and snippets

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/0023/0023000000nq000000.htm

I hope you'll  find SDK link helpful.
0 Kudos
SimonJackson
Occasional Contributor III
Can I ask a fairly basic (stupid?) question?
Do you need to have a button to open the dockable window?
I have added a dockable window to my Add-In (v10) and I am launching it from VS2010.

I can see via the Add-in manager that this add-in is in there, but I cannot see any window at run-time.

Do I have to then add a button to load the window?
0 Kudos
TomGiles
New Contributor
Richard and Jose,

Sounds like you may be missing the reference to ESRI.ArcGIS.Framework.

In VS in Solutions Explorer, double click My project and goto the References tab. Do you see the Framework reference loaded? The DockableWindowManager is part of ESRI.ArcGIS.Framework.IDockableWindowManager.

dubravko - Great, simple post. +1

jakc - I believe you need a button to launch it (at least that is the solution I have read about on multiple forums).
0 Kudos