WPF Control DPI scaling on Excel Task Pane

Add-in Express™ Support Service
That's what is more important than anything else

WPF Control DPI scaling on Excel Task Pane
 
Pierre Alain Carrier




Posts: 46
Joined: 2011-12-22
Hello,

we added a WPF control to a task pane using ElementHost. It works great except that when changing the DPI scaling on the monitor, nothing seems to happen. The control still displays properly, but there is no scaling what so ever.

We were expecting everything to scale by default for WPF. Are we missing something?
Posted 15 Dec, 2020 10:16:05 Top
Pierre Alain Carrier




Posts: 46
Joined: 2011-12-22
Just want to mention this is only happening with Per-monitor scaling. If we set a system wide scaling and log out, then log back in, it works properly.
Posted 15 Dec, 2020 10:51:38 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Hello Pierre,

The AddinExpress.MSO.ADXTaskPane component that controls your task pane instances provides the ADXTaskPane.DpiChanged event. You use that event to apply ScaleTransform; see https://www.c-sharpcorner.com/uploadfile/mahesh/scaletransform-in-wpf/. As to how to do this in a given task pane instance, check section Custom task panes in Office 2007-2019/365; see the PDF file in the folder {Add-in Express}\Docs on your development PC.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Dec, 2020 03:45:25 Top
Pierre Alain Carrier




Posts: 46
Joined: 2011-12-22
Thank you for your quick reply.
Posted 16 Dec, 2020 10:16:49 Top