Problem with WindowsFormsHost and the StandardSwitcher

Docking/MDI for WPF Forum

Posted 6 months ago by Niels Oltmanns
Version: 19.1.0685
Avatar

We have an WPF application where we use WindowsFormsHost to display windows controls from a third party vendor.
In an editor control, the Actipro StandardSwitcher via Ctrl+Tab does not work (we see two KeyUp events but only one KeyDown event).
Now we have registered an IMessageFilter in a separate class and want to start/display the StandardSwitcher manually when Ctrl+Tab occurs.

a) What could be the reason that a KeyDown-Event is 'swallowed'?
b) Which best practice would you recommend to us to start the StandardSwitcher manually?


With kind regards
Niels

Comments (1)

Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

DockHost captures PreviewKeyDown events and watches for switcher activation keys like Ctrl+Tab.  If found, it calls DockSite.ProcessDockHostKeyDown, which is protected virtual.  That method will pass the key onto the switcher and Ctrl+Tab makes the switcher open and handles the key.  I believe that's why you see it getting handled.

You might be able to make a class that inherits DockSite and add a method that calls into ProcessDockHostKeyDown.  Then in your IMessageFilter, call ProcessDockHostKeyDown and pass in a KeyEventArgs with Ctrl+Tab to kick in the normal open logic.


Actipro Software Support

The latest build of this product (v2020.1.1) was released 15 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.