This is a migrated thread and some comments may be shown as answers.

Excel add in high DPI problem

4 Answers 186 Views
Form
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 13 Dec 2018, 08:33 AM

Hi,

Changing the size of a form at runtime somehow messes up the control size / layout if DPI / scaling ist at >100%.

This only happens if the form is loaded inside an Excel add in, if the same form is loaded in a normal WinForms project everything is fine.

Attached is a sample Excel add in project.

 

Kind regards,

Christian

4 Answers, 1 is accepted

Sort by
0
Christian
Top achievements
Rank 1
answered on 13 Dec 2018, 08:35 AM
Sample project (rename to .zip)
0
Hristo
Telerik team
answered on 14 Dec 2018, 09:53 AM
Hi Christian,

Thank you for writing. I could not observe the reported behavior. I am attaching a screenshot showing the result on my end running the application on 150% scaling. Can you please try changing the RadForm with a standard form?  You can also set the RadControl.EnableDpiScaling property to false

Let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Christian
Top achievements
Rank 1
answered on 18 Dec 2018, 08:49 AM

Hi Hristo,

I've modified the example. (Tested with 200% scaling). Please use a slow-ish machine to test or a VM with low cpu/ram/graphic settings.

EnableDpiScaling true/false -> see attached screenshots

Using Form instead of RadForm makes a difference but the controls are still not 100% correct 

 

0
Hristo
Telerik team
answered on 20 Dec 2018, 12:06 PM
Hi Christian,

Thank you for writing back.

The Excel add-in is being loaded in the run-time of Excel which is a DPI-aware application. The screenshots indicate that the layout is distorted and this can happen after the controls` sizes increase. Their locations, however, will not change and it will be necessary to change them. This can be a big task depending on how complex the layout is. A possible solution is to design your form to be auto-sized and the controls to flow. Generally anchors and using the Dock property helps. You can refer to the following articles with more information on how this can be accomplished:
Please also make sure that you are working with the Winforms designer only on machines which are at 96 DPI (100%). Otherwise, you are risking to double-scale your app in a DPI-aware environment. This is a Visual Studio issue and it is logged here: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/7373263-winforms-designer-dpi-lock.

I hope this information is useful.

Regards,
Hristo
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Form
Asked by
Christian
Top achievements
Rank 1
Answers by
Christian
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or