Add-In Tab Key problems

1358
1
Jump to solution
10-10-2012 02:09 PM
RichardFairhurst
MVP Honored Contributor
I am trying to use VB.Net to create an Add-In form, but I have been having problems with the behavior of the Tab key.  I have tried both an Add-In DockableWindow and a System Windows Form, and cannot get the Tab key to behave the way I want.

Using a System Windows Form, the tab key does not work with a standard Combobox that has a populated list and the AutoCompleteMode set to anything other than None.  If the AutoCompleteMode is set to Suggest, for example, the Tab key simply does nothing after the Combobox gets focus.  The only way to exit the Combobox is to use the Mouse as far as I can tell.  I need the keyboard to be able to navigate the form.

With a DockableWindow the tab key works fine for the above Combobox, but it does not work with a custom component I have created that composites a DateTimePicker and a TextBox.  I get either too few tab stops or too many tab stops, depending on how I try to override the TabStop and TabIndex properties of the custom component to attempt to get the tab to focus on just the TextBox part of the component.  Has anyone successfully used a custom-built composit component with an Add-in?

Using a Windows Form Application I do not seem to have these problems, but I am not sure how to get that to interact with ArcMap Desktop.  Will I have to abandon using an Add-In to fix this problem?  Will a straight Windows Form application work with ArcMap Desktop, and where can I find help with setting it up and distributing an application built that way?  Thanks for any help.
0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Honored Contributor
I contacted ESRI support and they confirmed that when a Windows Form is modeless that the Tab key does not work for a Combobox that has AutoComplete settings other than None and a populated list.  I have asked them to file a bug report for that behavior.

However, the Tab key does work with both the AutoComplete Combobox and my custom component in a Windows Form when the Form is Modal.  For my particular project I can use the Modal Dialog (launching the Form with ShowDialog instead of Show).

My custom component still has Tab problems with a DockableWindow, so I cannot use a DockableWindow unless I can come up with a way to make that work.  But since that component is not a standard windows control I do not expect ESRI can offer me much help, so for now I am not going to use a DockableWindow.

So the Modal Windows Form is the only available solution at this time, in case this comes up for anyone else.

View solution in original post

0 Kudos
1 Reply
RichardFairhurst
MVP Honored Contributor
I contacted ESRI support and they confirmed that when a Windows Form is modeless that the Tab key does not work for a Combobox that has AutoComplete settings other than None and a populated list.  I have asked them to file a bug report for that behavior.

However, the Tab key does work with both the AutoComplete Combobox and my custom component in a Windows Form when the Form is Modal.  For my particular project I can use the Modal Dialog (launching the Form with ShowDialog instead of Show).

My custom component still has Tab problems with a DockableWindow, so I cannot use a DockableWindow unless I can come up with a way to make that work.  But since that component is not a standard windows control I do not expect ESRI can offer me much help, so for now I am not going to use a DockableWindow.

So the Modal Windows Form is the only available solution at this time, in case this comes up for anyone else.
0 Kudos