Approved
Last Updated: 04 Jan 2019 07:19 by ADMIN
ADMIN
Hristo
Created on: 21 Jun 2018 11:02
Category: Dock
Type: Bug Report
2
FIX. RadDock - in a DPI-aware application on Windows 10 the dock windows are down-scaled once floated
How to reproduce: check the attached project and video

Workaround:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent();
        radDock1.FloatingWindowCreated += RadDock1_FloatingWindowCreated;
    }

    private void RadDock1_FloatingWindowCreated(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e)
    {
        e.Window = new MyWindow(this.radDock1);
    }
}

public class MyWindow : FloatingWindow
{
    SizeF oldDpi = new SizeF(1, 1);

    public MyWindow(RadDock dockManager) : base (dockManager)
    { }
    protected override void HandleDpiChanged()
    {
        
        base.HandleDpiChanged();
        SizeF descale = new SizeF(1f / this.FormElement.DpiScaleFactor.Width, 1f / this.FormElement.DpiScaleFactor.Height);
        this.Scale(descale);
        var dpi = NativeMethods.GetMonitorDpi(Screen.FromRectangle(this.Bounds), NativeMethods.DpiType.Effective);
        if (oldDpi != dpi)
        {
            SizeF sz = new SizeF(dpi.Width / oldDpi.Width, dpi.Height / oldDpi.Height);

            this.Scale(dpi);
        }

        oldDpi = dpi;
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
2 comments
ADMIN
Hristo
Posted on: 04 Jan 2019 07:19
Hello Jacob,

Thanks for updating the workaround. Indeed, the theme might be lost so setting the ThemeName property is a possible solution.

Regards,
Hristo
Jacob
Posted on: 04 Jan 2019 02:48

One note is the theme is lost on the floating window. To add the theme back to the floating window add the below to the HandleDpiChanged method:

 

base.ThemeName = "Fluent";