Make a simple dockable window and open it with a button (C#)

4230
2
09-01-2010 05:55 PM
Highlighted
New Contributor II
Hello All,

I am using the VS2008 Add-In Manager to make a dockable window and a button.  How do I get a button to open the dockable window (in ArcMap....)  I tried going through some of the Developer Samples on my computer and there is all sorts of funky code with GUID's and other stuff that I don't understand.... is it really that much harder than VBA? (ie. MyForm.Show)

Using C#....

Thanks,
JMiller
Reply
0 Kudos
2 Replies
Highlighted
Occasional Contributor II
I've created a Add-in project with a button and a dockable window. Here is an example of how you can show a dockable window from the buttons click event.


        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);
        }
Highlighted
New Contributor II
That is the most beautiful thing I have seen today....  Yes, I am easily amused....

Thanks for your help!
JMiller
Reply
0 Kudos