programit
programit

Reputation: 119

Visual studio editor window stealing focus

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?

Upvotes: 0

Views: 281

Answers (1)

Sergey Vlasov
Sergey Vlasov

Reputation: 27930

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.

Upvotes: 1

Related Questions