I have inherited an bigger C# Project from a college (hes gone so I can't ask him anymore). Im on VS2012 + .Net4.6 The first time in this Project I added a WPF Textbox to a nonmodal Window. The problem is: I cant change the text in the TextBox.
What I found out are the following facts:
We have an own WPF-Window-Style, but it doesn't matter, if I use this style in the window or not.
Can anybody tell me whats the difference of the behavior of TextBoxes in modal / nonmodal Windows. Could you give me a tip, where I could look for a Modification of the behavior between the FromTheScratchProject and our project? Can I debug the eventhandling somehow?
Thank you a lot
It seems like your project is a mix of WinForms/Win32 and WPF.
If you instantiate your window in following way, your non-modal window will catch the keyboard events correctly:
Window wpfWindow = new Window();
ElementHost.EnableModelessKeyboardInterop(wpfWindow);
wpfWindow.Show();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.