Add-Ins: How to add controls to dockable window

1867
10
Jump to solution
03-27-2013 05:49 AM
JimMeuse
New Contributor
I have been experimenting a bit with creating add-ins for ArcGIS Desktop.  I can create buttons, tools, dockable windows, ect.  But I cannot figure out how to add a control to a dockable window.  I know this is possible from reading ESRI's documentation..how can I do this?  Thanks.
0 Kudos
1 Solution

Accepted Solutions
AlexanderGray
Occasional Contributor III
ok...  I am not sure I see the problem.  Can't you just drag and drop controls from the toolbox onto the control like any .net form or control?

View solution in original post

0 Kudos
10 Replies
LeoDonahue
Occasional Contributor III
Check out John's thread here
0 Kudos
JimMeuse
New Contributor
Thank you. That thread describes a dockable window which is referencing an existing control in another dockable window.  However, my issue is a lot more basic; all I want to do is add a control to a dockable window.  Right now all I can do is create a blank dockable window.

Am I supposed to reference a control which which exists in my solution from the dockable window?  If so, what is the code for doing this?
0 Kudos
LeoDonahue
Occasional Contributor III
0 Kudos
JimMeuse
New Contributor
Thanks, I did see that thread.  Although the intial question mentions adding a toolbar control to a dockable window, the substance of the replies address setting references to existing ESRI tools to buttons created within a created toolbar.
0 Kudos
AlexanderGray
Occasional Contributor III
If you want to add ArcGIS commands to a dockable window, you will need to add an engine toolbar control.  For that you will need engine sdk installed and an engine developer license.  You can however add .net controls such as buttons (assuming .net is your dev environment) which finds the arcgis command and executes it.
0 Kudos
JimMeuse
New Contributor
Thanks, Alexander

I don't have an engine developer license; but adding a .NET control which finds an arcgis command would work.  But how do I add a .NET control to the dockable window I already created?

I should mention that I added the dockable window using ArcGIS >> Desktop Add-Ins >> Add-in Component.
0 Kudos
AlexanderGray
Occasional Contributor III
Do you have visual studio and the original code for the dockable window?
0 Kudos
JimMeuse
New Contributor
I have Visual Studio 2010 Professional and ArcGIS 10.1.

Here is code, all of which was automatically created by Visual Studio when the dockable window was created; the code file name is "ArcGISAddin3.cs" as shown in the Solution Explorer:

namespace CustomUIElements
{
    partial class TestDockableWindow
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.SuspendLayout();
            //
            // TestDockableWindow
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.Name = "TestDockableWindow";
            this.Size = new System.Drawing.Size(300, 300);
            this.ResumeLayout(false);

        }

        #endregion

    }
}

Thank you.
0 Kudos
AlexanderGray
Occasional Contributor III
ok...  I am not sure I see the problem.  Can't you just drag and drop controls from the toolbox onto the control like any .net form or control?
0 Kudos