How to create a Textbox on a toolbar in ArcGIS 10.2?

3434
2
04-14-2014 09:45 AM
DuncanHornby
MVP Notable Contributor
All,

I am porting an old VB6 project to a 10.2.1 VB .Net ESRI AddIn and hit the "wall".

On the old VB6 toolbar I had a TextBox which was an editbox on a form with a class implementing IToolControl and ICommand. I am attempting to recreate this as part of my AddIn toolbar.

First of all unless I have missed something there is no textbox addin?

Assuming this is the case I have created a usercontrol with nothing more than a label and an editbox on it. I have then created a class that implements IToolControl and ICommand.

In this Class I have a private object which is an instance of the userControl

Private m_UC As HER_AddIn.ucTextBox = New HER_AddIn.ucTextBox


In the property hWnd I return

    Public ReadOnly Property hWnd As Integer Implements ESRI.ArcGIS.SystemUI.IToolControl.hWnd
        Get
            Return m_UC.Handle.ToInt32
        End Get
    End Property


So far so good...

Now I want to add this usercontrol to the toolbar, how do I actually do that? What am I supposed to write in the Config.esriaddinx file? Typically you declare a <command> and then reference that command in the <toolbar>
The only options when creating a command are <Button>,<Combobox>,<MultiItem>,<Tool> etc

How on Earth do I add a usercontrol to the AddIn toolbar?
0 Kudos
2 Replies
SamuelHenderson
New Contributor II

I am attempting to do the same thing you are, however instead of a textbox I want to have an image appear on the toolbar (not like a button or tool image though).

Here's what my legacy COM extension I am trying to turn into an add-in looks like:

Toolbar+help.png

In the COM extension I had the image in an image container in the UserControl.  So yeah, basically the same as your textbox.

Have you made any progress or found any solutions/workarounds Duncan Hornby‌?

0 Kudos
DuncanHornby
MVP Notable Contributor

Hi Samuel,

My solution was to give up! I was surprised no one from ESRI offered up an answer even if it was "you are an idiot you are doing it the wrong way" or  "no can't be done"

I abandon the Textbox and created a dockable window which was something that I could display a textbox on and hook into. So it was a radical change from the previous interface.

I think the AddIn framework is great but I came to the conclusion (which may be completely wrong) that you can't add controls that are not part of the AddIn framework as there seemed to no mechanism to declare them in the Config file.

Duncan

0 Kudos