Visual studio editor window stealing focus

旧街凉风 提交于 2019-12-25 08:53:50

问题


I'm working on a visual studio extension. It has a command that opens up a WPF window that has a single item which is a textbox. If you type in the textbox you can see the text show up, but if you hit a key combination such as ctrl+a the visual studio editor which is behind my window captures the key press and selects the content from the editor instead of my window. If I click on something like the solution explorer and go back to my window though ctrl+a will work fine. It seems that I only have the issue while the editor has focus. Any ideas what I can do to get around this?


回答1:


Open your WPF window as modal using ShowDialog or create a Visual Studio tool window to host your textbox, if you want a modeless window.



来源:https://stackoverflow.com/questions/40275337/visual-studio-editor-window-stealing-focus

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