Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't type on a WPF window in a VSTO addin

Tags:

c#

vsto

I have a WPF window that pops up when triggered. The popup window has a couple of text boxes. When I select one of the text boxes and begin typing, the focus goes on the Excel spreadsheet and the keystrokes get sent to the active cell. Anyone know how I can fix that?

Thanks

like image 801
Gerson Avatar asked Feb 14 '23 23:02

Gerson


1 Answers

I found the solution.

The following property must be changed before showing the popup window.

Globals.ThisAddIn.Application.Interactive = false;

And then reset to true on close

Globals.ThisAddIn.Application.Interactive = true;
like image 149
Gerson Avatar answered Feb 27 '23 15:02

Gerson