Unplanned
Last Updated: 24 Dec 2020 11:20 by ADMIN
ADMIN
Dimitar
Created on: 22 Nov 2018 06:40
Category: Dock
Type: Bug Report
1
FIX. RadDock - the auto-hide window is not scaled properly
To reproduce: 
See attached video.

Workaround:
public Form1()
{
    RadDockEvents.TabStripItemCreating += RadDockEvents_TabStripItemCreating;
    InitializeComponent();
    radDock1.AutoHideAnimation = Telerik.WinControls.UI.Docking.AutoHideAnimateMode.None;

}
void RadDockEvents_TabStripItemCreating(object sender, TabStripItemCreatingEventArgs args)
{
    if (args.AutoHide)
    {
        var currentScale = args.TabItem.DpiScaleFactor;

        Screen showScreen = Screen.FromControl(this);
        SizeF scale = NativeMethods.GetMonitorDpi(showScreen, NativeMethods.DpiType.Effective);
        if (scale != currentScale)
        {
            var font = args.TabItem.Font;
            var newFont = new Font(font.Name, font.Size * scale.Width, font.Style);
            args.TabItem.Font = newFont;
        }
    }
}
protected override void OnClosed(EventArgs e)
{
    RadDockEvents.TabStripItemCreating -= RadDockEvents_TabStripItemCreating;
    base.OnClosed(e);
}
2 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 24 Dec 2020 11:20

Hi, Paul,

Yes, the NativeMethods class is available in the Telerik.WinControls namespace and it requires adding of the TelerikCommon.dll which is necessary for all project that use the Telerik UI for WinForms controls.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Paul
Posted on: 24 Dec 2020 10:45

NativeMethods is this one: 

Telerik.WinControls.NativeMethods