1
votes

I'm developing a Microsoft Word TaskPane containing a WPF ElementHost. The hosted WPF uses a Popup that is intended to behave as a ComboBox's does. I believe you can reproduce my problem like this:

popup.IsOpen = true;
popup.StaysOpen = false;
Mouse.Capture(ancestor_of_popup, CaptureMode.SubTree);

When a region of the Popup lies outside the bounds of the TaskPane, click the mouse in that region. The entire TaskPane loses keyboard focus to Word's main window, but retains mouse capture. At this point, you can use the Popup with a mouse while typing on the keyboard edits your document!

If the TaskPane loses keyboard focus then the Popup should close, but then any control in the region of a Popup that lies outside the bounds of the TaskPane becomes unusable. Any ideas?

1
just noticed stackoverflow.com/questions/619798/… , checking to see whether this solves it.Joshua Tacoma
nope, that didn't solve it: 619798 is about transparency; i've got a sneaky suspicion mine has something to do with microsoft office interop.Joshua Tacoma
I'm seeing a very similar issue working on a custom Word Add-in. Did you ever resolve your issue?Jacob Adams

1 Answers

0
votes

This looks like a similar problem to Popups in XBAP stop receiving anything but mouse events after losing focus?.

Apparently there is a known bug with focus in WPF popup controls, although that may be specific to XBAP (you didn't specify if this was a WPF desktop or browser application).