jfinken

No keyboard events fire within DockableWindow

Discussion created by jfinken on Oct 14, 2010
We've developed an Add-In for ArcGIS 10 (ArcObjects for .NET), the main component of which is a DockableWindow.  If the dockable window is wired for keyboard events and has focus, should it receive keyboard events?

Dockable Window sample code:
// in FooBarWindow.Designer.cs
namespace Foo
{
    partial class FooBarWindow
    {
         ...
         private void InitializeComponent()
         {
              ...
             this.PreviewKeyDown += new PreviewKeyDownEventHandler(FooBarWindow_PreviewKeyDown);
            this.KeyDown += new KeyEventHandler(FooBarWindow_KeyDown);
            this.KeyPress += new KeyPressEventHandler(FooBarWindow_KeyPress);
            this.KeyUp += new KeyEventHandler(FooBarWindow_KeyUp);
         }
        void FooBarWindow_KeyUp(object sender, KeyEventArgs e)
        {
            throw new System.NotImplementedException();
        }
        void FooBarWindow_KeyDown(object sender, KeyEventArgs e)
        {
            throw new System.NotImplementedException();
        }
        void FooBarWindow_KeyPress(object sender, KeyPressEventArgs e)
        {
            throw new System.NotImplementedException();
        }
       
     }
}
// in FooBarWindow.cs
 public partial class FooBarWindow : UserControl
 {
    ...
    public class AddinImpl : ESRI.ArcGIS.Desktop.AddIns.DockableWindow
    {
        private FooBarWindow m_windowUI;
        ....   
    }
}


No exceptions are thrown, no key events fire.  Thoughts? 

Many thanks.

Outcomes