WPF modeless dialog renders textbox uneditable

牧云@^-^@ 提交于 2019-12-01 17:39:20

问题


A WPF form that I launch from a WinForms window shows up with all textboxes as uneditable when it's launched as a modeless dialog. It works well when it's a modal window. I'm still able to type spaces or paste text. But regular typing doesn't work. I'm using 3.5 with SP1. Would anybody know how to resolve this?


回答1:


You need to make sure to call ElementHost.EnableModelessKeyboardInterop for your WPF Window. This hooks up the WPF message loop to allow keyboard input.



来源:https://stackoverflow.com/questions/5818294/wpf-modeless-dialog-renders-textbox-uneditable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!