PDA

View Full Version : Add-In Form Does Not Receive Keys



SatelliteSurfer
03-12-2012, 04:39 PM
I want to add some common keystroke functions to my add-in. For example, Control+S saves information from the Add-Ins main form. However, when I press Control and S, the Save Dialog for MapPoint appears rather than saving the information from my add-in.
I have tried setting the KeyPreview on the Form to true but it did not seem to help capture the key event. Similarly, I find I am not able to use the Tab key to move between fields on the Form.
My add-in is built on C# using Visual Studio 2008 Standard.
Any ideas?

Joe

Winwaed
03-13-2012, 08:36 AM
Are you sure your add-in's dialog has the focus? I haven't tried using hotkeys such as Control-S with addins, but I have tested the tab order of controls in my dialog boxes (yes C# ones) and TAB does work..

Eric Frost
03-13-2012, 09:03 AM
Can you have hidden or 1px buttons with the shortcut key assigned? I'm not sure if it would still conflict with the built-in shortcut keys, so maybe only use ones that don't conflict?

Eric

SatelliteSurfer
03-14-2012, 05:59 PM
Are you sure your add-in's dialog has the focus? I haven't tried using hotkeys such as Control-S with addins, but I have tested the tab order of controls in my dialog boxes (yes C# ones) and TAB does work..

Thanks for replying! The main window of the add-in has focus when I attempt to Tab between fields or use a hotkey. When I use a Control-S or Control-O, the Save and Open dialogs for MapPoint appear but my add-in does not react. My add-in has its own dialog for Options. In the Options dialog, I can use the Tab key to navigate between fields.

Joe

SatelliteSurfer
03-14-2012, 06:01 PM
Can you have hidden or 1px buttons with the shortcut key assigned? I'm not sure if it would still conflict with the built-in shortcut keys, so maybe only use ones that don't conflict?

Eric

Thanks! I might give that a try.

Joe

Andersan
10-30-2014, 11:46 PM
My add-in has its own dialog for Options. In the Options dialog, I can use the Tab key to navigate between fields.