C1DockControlPanel ArrangeOverride throws ArgumentException when Rect width/hei

Posted by: anh.dt2 on 16 September 2025, 11:27 pm EST

  • Posted 16 September 2025, 11:27 pm EST

    Hello,

    We are using C1.WPF.Docking 4.6.20233.801 and have encountered a recurring crash in C1DockControlPanel.ArrangeOverride.

    The exception is:

    System.ArgumentException: Width and Height must be non-negative.

    at System.Windows.Rect…ctor(Double x, Double y, Double width, Double height)

    at C1.WPF.Docking.C1DockControlPanel.ArrangeOverride(Size finalSize)

    This occurs when a C1DockTabControl is docked with DockMinHeight=“0” (or DockMinWidth=“0”) and the application is running on a laptop with 125% DPI scaling. In these cases, the internal layout tree (Node._0023fmd) sometimes calculates a negative width/height (e.g. -0.5), which results in the Rect constructor throwing.

    It does not happen consistently, but it is reproducible on some machines when resizing or docking/undocking at non-100% DPI.

    Steps to Reproduce:

    Use C1DockControl with a C1DockTabControl configured as:

    <c1:C1DockTabControl Dock="Left" DockMode="Docked" MinWidth="65" MinHeight="30" DockMinWidth="65" DockMinHeight="0" />

    Run on Windows with 125% display scaling.

    Resize the window or drag splitters to force layout recalculation.

    Occasionally, the application crashes with ArgumentException.

    Expected Behavior:

    The DockControl should never produce a negative width/height during arrange. Negative values should be clamped to 0 internally, avoiding exceptions.

    Questions:

    Has this bug already been fixed in a later version of ComponentOne WPF Docking?

    If yes, in which version was the fix included?

    If not yet fixed, is there a recommended workaround or hotfix?

    Environment:

    ComponentOne WPF Docking 4.6.20233.801

    .NET Framework 4.8.1

    Windows 10/11 laptops with 125% display scaling

  • Posted 17 September 2025, 5:27 am EST - Updated 17 September 2025, 6:48 am EST

    Hi,

    We tested the scenario you mentioned using the 2023v3(801) version of the C1.Xaml.WPF.Docking package on two machines (Windows 10 and 11) with display scaling set to 125%, but we could not reproduce the issue on our end. We have attached the sample project for your reference. We also searched our records and did not find any similar issues reported or resolved in the past.

    Could you please update this sample project to reproduce the issue you are facing? If running the sample shows the issue on your end, please also share a short video demonstrating the exact steps you follow to reproduce the exception. This will help us investigate the further and assist you better.

    Additionally, we request you to test this issue using the latest 2025v1(882) version to see if it the issue gets resolved.

    Attachment: DockControlException.zip

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels