Unplanned
Last Updated: 04 Aug 2020 10:46 by ADMIN
Henk
Created on: 29 Jul 2020 09:07
Category: Dock
Type: Bug Report
3
RadDock: adjust the size of a Toolwindow when it is moved between monitors with different DPI scaling
Please run the sample project in an environment with left monitor at 150% DPI scaling and right monitor at 100%. You will notice that the ToolWindow remains with fixed width.
3 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 04 Aug 2020 10:46
Hello, Henk,

If the form is a MDI child form, you should override the HandleDpiChanged method of the MDI parent form and iterate the MDI children. Then, you can adjust the ToolWindow size of the desired child form: 
Public Class MainForm
    Sub New()
        InitializeComponent()

        Me.IsMdiContainer = True

        Dim childForm As New RadForm1
        childForm.MdiParent = Me
        childForm.Show()
    End Sub

    Protected Overrides Sub HandleDpiChanged()
        MyBase.HandleDpiChanged()
        For Each f As Form In Me.MdiChildren
            Dim form As RadForm1 = TryCast(f, RadForm1)
            If form IsNot Nothing Then
                form.ToolWindow1.TabStrip.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute
                form.ToolWindow1.TabStrip.SizeInfo.AbsoluteSize = New Size(200 * form.RadDock1.RootElement.DpiScaleFactor.Width, 0)
            End If
        Next
    End Sub
End Class

I believe that it would cover your scenario.

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

Henk
Posted on: 30 Jul 2020 06:52

Hi Dess,

this only works when the form is not hosted in a mdicontainer. 

Regards,

Henk

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 29 Jul 2020 09:20

Hi, Henk,

The possible solution that I can suggest is to adjust the fixed size of the tab strip according to the current scale factor. Override the form's HandleDpiChanged method where you can introduce the changes to any window you want:

Public Class RadForm1

    Protected Overrides Sub HandleDpiChanged()
        MyBase.HandleDpiChanged()
     
        Me.ToolWindow1.TabStrip.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute
        Me.ToolWindow1.TabStrip.SizeInfo.AbsoluteSize = New Size(200 * Me.RadDock1.RootElement.DpiScaleFactor.Width, 0)
    End Sub

End Class

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