办公室addin自定义任务窗格显示问题
我创建了AC#VSTO Office Addin,该Office Addin暴露了自定义任务窗格。
所有Office Task Pane都需要使用sytem.windows.forms.usercontrol创建。在此UserControl中,我添加了一个system.windows.forms.integration.elementhost能够在任务窗格中支持WPF。
所有这些都非常有效,直到我在具有不同DPI环境的多监视器中遇到了Combobox项目的显示问题。
我使用两个监视器:
第一个监视器,设置为主监视器:
- 分辨率:3840*2160
- 文本,应用程序和其他项目的尺寸:200%
第二监视器:
- 分辨率:1920*1080
- 文本,应用程序和其他项目的大小: 100%
直接从第二个监视器打开PowerPoint时,Combobox的项目无法单击,
我创建了一个可再现的回购,其中所需的最小代码和视频说明了该行为: https://github.com/guillaumepoweruser/taskpaneaddin
我已经阅读了很多关于DPI的主题,并且找不到任何方法来解决此ComboBox问题。我尝试了我发现的在线解决方案,例如创建app.config,创建和app.manifest或调用nativemethods.setProcessdpiawareness在thisaddin_startup中的一开始。
我为此而苦苦挣扎,任何帮助将非常欢迎!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论