Hi,
I am working on making our Winforms UI projects DPI aware to clean up fuzzy text in Windows 10.
I'm having an odd issue with some layouts. In one example, we have a simple form dialog that will grow with a label inside (similar to a windows message box). THe label is autosizing itself and has a minimum and maximum size set. This dialog is working fine without the DPI awareness, however, after enabling, the RadForm resizes to some strange size. I tried to investigate and it seems that the label is resizing to some large size and not respecting it's maximums (though this doesn't show when rendering as I've switched off the borders).
The label is resizing the form via anchors. I think probably there is a better way at layout here, but I'm wondering if the wild resizing may be considered a bug.
See images below.
I've also attached a project that reproduces this issue.
Hello, Dan,
Your question has already been answered in the other thread (Ticket ID: 1468172) you have opened on the same topic. Please, see our answer there for more information.Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Thanks Dess, I can try this.
However... another issue that is very common occurs without any AutoSize or Right/Bottom anchor in use. I'm finding that the form container scaling doesn't match when using DPI awareness.
For example, consider the following sample images where all controls are NOT Autosize and all anchors are default (Top/Left), and the form Autosize is also false. The form is produced with nice margins when DPI awareness is disabled. However, when DPI awareness is enabled and the form is displayed on a 125% scale, the form margins at bottom and right is extended. This problem is worse with higher scales and larger forms.
Is there some approach that can eliminate this issue?
Thanks,
Dan.
I have logged it in our feedback portal by creating a public thread on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.
I have also updated your Telerik points.
Currently, due to the specificity of DPI scaling in combination with anchoring controls, the possible solution that I can suggest is to remove the bottom|right anchor for the label and apply some bottom margin for it to avoid overlapping with the button.
this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)))));
this.lblMessage.Margin = new System.Windows.Forms.Padding(0, 0, 0, 50);
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Hi Dess,
Thank you for your response!
However, the intent here is to automatically grow the dialog to try and fit the text without the user having to resize it.
The standard windows MessageBox class does this, and we have made something similar with a RadForm, but now, as we try to enable high DPI support... what we have is not working.
Our approach (that works with dpi aware disabled), is to have an auto-size label with min/max size, contained in an auto-size form with anchors. When the label size adjusts to the text, the form automatically grows.
There are a few cases like this in our code, and it seems to work well until we have tried the DPI awareness.
The strange behaviour does seem like a bug... however, maybe there is another solution that will work for our desired functionality, that will also work for high DPI. Please let me know your thoughts.
Thanks,
Dan.
Hello, Dan,
The provided sample project and detailed explanation with screenshots are greatly appreciated.Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik