I have created a c# vsto office addin that exposes a custom task pane.
All office task pane need to be created using a Sytem.Windows.Forms.UserControl. In this userControl I have added an System.Windows.Forms.Integration.ElementHost to be able to support WPF in the task pane.
All this was working very well until I faced a display issue with a combobox item in a multi monitor with different DPI environment.
I'm using two monitors:
First monitor, set as main monitor:
- Resolution: 3840*2160
- Size of text, apps, and other items: 200%
Second monitor:
- Resolution: 1920*1080
- Size of text, apps, and other items: 100%
When opening PowerPoint directly from the second monitor the items of the combobox are not clickable
I have created a reproducible repo with the minimum code needed and explanations with a video showing the behavior: https://github.com/guillaumepoweruser/TaskPaneAddIn
I have read much on the subject of DPI and cannot find any way to fix this ComboBox issue. I have tried the online solutions I have found such as creating an app.config, creating and app.manifest or calling a NativeMethods.SetProcessDpiAwareness as the very begining in ThisAddIn_Startup.
I'm struggling with this, any help will be very welcome!