No Keyboard Input in WindowsFormsHost after Interacting with Ribbon TextBox or ComboBox

Posted 10 months ago by Avatar Nathan Hanson

Hi, so this is a weird one so hang in there with me. I'm really stumped and not sure what to do.

I have an application with an Actipro WPF Ribbon Window with a ribbon containing a few ribbon text boxes and combo boxes on it. Then in the document area below the ribbon I have a WinForms control that's hosted inside a WindowsFormsHost object. When I interact with the textbox or the combobox on the ribbon by clicking to change the selection or clicking and typing and then I click the WinForms control to change focus back to it, that WinForms control no longer gets any keyboard input.

It's as if the keystrokes are still going to the ribbon controls and I can't find anyway to get keyboard focus to move back to the WinForms control. I have to restart the app to get the ribbon controls to stop eating the keyboard input. We're getting to within days of shipping our app and I'm running out of ideas. Any thoughts you have would be very welcome. I'm also happy to provide a sample app if that helps.

Thanks in advance!


[Modified 10 months ago]

Comments (3)

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

Hi Nate,

I'm sorry you're running into trouble.  I haven't heard of anything like that but WPF/WinForms interop focus can sometimes be wonky.  Can you make a new simple sample project showing this happening so we can debug it and send that over to our support address, referencing this thread?  Please exclude the bin/obj folders from the ZIP and rename the .zip file extension so it doesn't get spam blocked.  Thanks!

Actipro Software Support
Posted 10 months ago by Nathan Hanson

Thanks for the response. As I was building my test app to send in I discovered I'd set 

HwndSource.DefaultAcquireHwndFocusInMenuMode = false;

in my App.xaml.cs. This appears to be what was messing up my keyboard focus for legacy windows in WindowsFormsHost after interacting with the Actipro Ribbon controls. Once I removed that line, keystrokes started flowing again and all is well.

Thanks again for your help and the great components. We're about to ship our brand new, clean. modern UI featuring your Ribbons and Docking and response during beta testing has been very positive. I really appreciate it!

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

Hi Nathan,

Great, I'm glad you sorted it out and thanks for the comments.  Good luck with your app deployment in the next few days!  And feel free to post a link to some screenshots of it.  We love to see what our customers create with our controls.

Actipro Software Support
Information The latest build of this product (2018.1 build 0671) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.