WPF window displayed using Show (not ShowDialog) in VSTO project - ComboBox issue

Guillaume CHAFFAROD 6 Reputation points
2021-03-23T15:21:18.67+00:00

In a VSTO 2010 solution (Excel workbook document-level), when a Window containing a ComboBox is displayed using Show() instead of ShowDialog() the popup list will close as soon as the mouse is released, contrary to expected behavior of remaining open until a selection is made or the control loses focus.

Moreover, if the ComboBox is clicked and released (causing the list to flash on and off) without a selection being made, the window itself (the top bar and minimize/maximize/close buttons) is not clickable.
Other controls in the window body continue to function.

We have a plugins system that allows developpers to extend functions of the main application and they may create WPF windows as well as display them using Show (and not ShowDialog) so we can't use custom hack as it would mean that we ask every third parties developers to do so and it's not acceptable.

Thank you very much for providing us a solution.

Best regards,

Guillaume

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,669 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,475 questions
{count} vote