Completed
Last Updated: 02 May 2019 16:10 by ADMIN
Release R2 2019
wpa1160
Created on: 12 Mar 2019 06:37
Category: UI for WinForms
Type: Bug Report
1
RadControls: The anchors does not work on HDPI
Use attached to reproduce. Broken in version 2018.3.1016.40

Workaround:
private Size minSizeState;
private Size maxSizeState;
protected override void HandleDpiChanged()
{
    //base.HandleDpiChanged();

    float scaleFactor = 1f;

    if (this.oldDpi != 0)
    {
        scaleFactor = (float)this.currentDpi / this.oldDpi;
    }
    else if (this.oldDpi == 0) //Form shown for the first time.
    {
        scaleFactor = (float)this.currentDpi / 96f;
    }

    if (scaleFactor == 1f)
    {
        return;
    }

    this.maxSizeState = this.MaximumSize;
    this.minSizeState = this.MinimumSize;
    this.MinimumSize = Size.Empty;
    this.MaximumSize = Size.Empty;
    
    this.Scale(new SizeF(scaleFactor, scaleFactor));
   
    this.MinimumSize = TelerikDpiHelper.ScaleSize(this.minSizeState, new SizeF(scaleFactor, scaleFactor));
    this.MaximumSize = TelerikDpiHelper.ScaleSize(this.maxSizeState, new SizeF(scaleFactor, scaleFactor));

}
 
0 comments