When using a Combobox in a WPF UserControl
via ElementHost
for a VSTO AddIn, the Combobox items that are outside of the parent Office application cannot be selected.
In the clip below, the blue area is a WPF UserControl
inside an ElementHost
and you will see that '11111111' gets selected, but 'CCCCCCCC' does not because it is outside of the Outlook window. The second Combobox is just a plain WinForms Combobox and all items work fine, even outside the parent Outlook window.
The Addin in the clip is just a super simple VSTO addin with a single CustomTaskPane
, a WPF UserControl
hosted inside an ElementHost
(blue box), and then a plain WinForms Combobox.
I also tested creating a regular .Net WinForms Desktop application with this same WPF UserControl
inside an ElementHost
, and it works fine. So this leads me to believe its something with VSTO, but I have been unable to find any good info on how to fix.
Has anyone ran across this and know if it can be fixed? Telling users to just maximize their Outlook window worked for a little while, but not an ideal solution.