High DPI Monitors show ADX Form control

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

High DPI Monitors show ADX Form control
 
TheNewCOMAddin Dev




Posts: 26
Joined: 2019-07-11
Hi,

Our Outlook Addin is working fine on systems with 100 / 150 and 175% Scaling however, when it becomes 200% + and clients use it on Full HD + : 2K and 4K monitors, the controls / buttons appear mangled.

We tried putting the "AutoScaleMode" = DPI. However this does not seem to resolve the issue.

We looked at some of the blog posts regarding multi monitor and wondering if this is what we need to do to cater to this high DPI issues :
https://www.add-in-express.com/creating-addins-blog/2018/05/08/add-in-express-multiple-dpi-monitors/

Any examples for this specific to Outlook with ADXFormCollection reading pane / inspector elements would really help.

Thanks,
-Jatin
Posted 11 Feb, 2020 03:16:03 Top
Andrei Smolin


Add-in Express team


Posts: 17132
Joined: 2006-05-11
Hello Jatin,

This also depends on what monitor is the main one. You need to debug this scenario as well.

Controls are always scaled for the DPI of the main monitor; even on the secondary monitor. You should use the ADXDPIChanged to scale controls for the DPI of the current monitor (the one that shows the window/pane). Find more information in High DPI support in Windows Forms and Add-in Express version 9 adds support for multiple monitors in Office.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Feb, 2020 04:48:41 Top
TheNewCOMAddin Dev




Posts: 26
Joined: 2019-07-11
Hi Andrei,

If I understand correctly we have and need to handle 2 issues :
1)On the primary monitor when its high resolution i.e 200%+ Scaling on 2k / 4k resolution there is distortion.
2)In a multi monitor setup we need to consider DPI changed event and scale all controls in the form.

Just to let you know what happens (Point 1) is till certain resolution.. all buttons in my form look fine the moment we scale up.. the form we added to display via ADXFormManager in reading pane (top) gets distorted and the button kind of cut off.

Our project is based on 4.6 .Net Framework : If I understand correctly this link High DPI Support in Windows Forms considers that application is 4.7 based ? Is that accurate ? What are the solutions for 4.6.

I believe the UpdateDPI part is solution for the 2) however, we seem to have issues for 1) what needs to be done as a solution for 1) ?

Thanks again for the help,
- Jatin
Posted 11 Feb, 2020 06:27:40 Top
Andrei Smolin


Add-in Express team


Posts: 17132
Joined: 2006-05-11
Hello Jatin,

You shouldn't choose what DPI or monitor configurations to handle. The ADXDPIChanged event (it provides the dpi and dpiScale parameters) will occur whenever you need to scale your controls. The UpdateDPI method which you found in the example, works correctly for controls that allow scaling. If you have a control(s) that doesn't let you scale it (say, System.Windows.Forms.CheckBox, ComboBox, RadioButton, etc. may scale partially; other controls may have other problems; WPF scales okay), you'll have to find your way out of this. You may need to go as far as to create a custom control. This isn't a simple process. We recommend that you do this step by step, preferably by debugging a small sample project.

Note that you may need to check and set the context; see High DPI Desktop Application Development on Windows.

Hope this helps.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Feb, 2020 08:10:20 Top