ToolWindow with collapsed height after layout reload

Docking/MDI for Windows Forms Forum

The latest build of this product (v25.1.2) was released 5 months ago, which was before this thread was created.
Posted 2 months ago by A. Willerding
Version: 24.1.1
Platform: .NET 8
Environment: Windows 11 (64-bit)
Avatar

[Update:] It also occurs with version 25.1.2.

The problem occurs in a certain tool window layout constellation:

  • One ToolWindowContainer is docked to the left.
  • A DockContainerContainer with vertical orientation is docked to the right.
    It contains two ToolWindowContainers on top of each other. Their heights are evenly distributed across the total height
  1. Save tool window layout to file
  2. The sizes of all tool windows and their containers are stored correctly in the layout data document.
  3. Load tool window layout from file

Result:

  • The top ToolWindow in the right DockContainerContainer has shrunk to its minimum height, which is a few pixels only
  • The bottom ToolWindow filled the remaining space

As soon as I move the left-docked ToolWindowContainer to somewhere else, the problem no longer occurs.

What could be the cause?

[Modified 2 months ago]

Comments (3)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Could you please help describe how to recreate the issue using our Sample Browser?  I tried to recreate it using the steps you provided, but could not.  Here is what I tried.

  1. Open the Sample Browser and run the Dockimg/MDI Features demo.
  2. Dragged the "Tool Window Properties" group (which includes both "TW Properties" and "Mgr Properties" tabs) to the right side.  This left only the "Welcome to WinForms Studio" on the left, which should satisfy your first bullet point.
  3. I dragged the tab for "TW Properties" tool window and dropped it to dock at the bottom of that group.  This resulted in the "DockManager Properties" tool window on top and the "Tool Window Properties" tool window on the bottom, both with equal heights.  This should satisfy your second bullet point.
  4. I closed the "Events" tool window since you did not mention any other tool windows in the layout.

So at this point I have one tool window on the left, and two tool windows on the right (one of top of the other).  I save the layout and then restore the layout.  After restore, everything looks the same.

I also tried moving tool windows around to "disrupt" the layout before restoring, and everything still looks correct.

If you can recreate in the Sample Browser application, please let me know the corrected steps to reproduce.  If you cannot reproduce in the Sample Browser, could you please create a simple sample application that demonstrates the issue and send to our support email address referencing this forum post?  If so, please delete any bin/obj folders from the project before zipping or else the attachment may be blocked.


Actipro Software Support

Posted 2 months ago by A. Willerding
Avatar

Hi, 

actually, I've found a way to reproduce the issue in your Sample Browser – with a small modification and under a specific boundary condition!

Have a setting with two monitors:

  • monitor 1 with 150% scaling (my resolution is 3840x2160)
  • monitor 2 with 100% scaling (my resolution is 1920x1200)

Modify the SampleBrowser:

  1. Open the SampleBrowser solution (I took the one from Actipro WinForms 24.1.1, because we have a license for that)
  2. Open SampleBrowser\Program.cs
  3. In line 67, where the high DPI mode is set, change the value to HighDpiMode.PerMonitorV2
  4. Build

Now you should get a build for net8.0-windows.

Reproduce issue:

  1. Start SampleBrowser.exe on monitor 1
  2. Launch "Docking/MDI Features" Sample
  3. Move the "Dock C# Sample" window to monitor 2

Now you can take the steps exactly like you described them in your previous comment.
Alternatively, you can use the ToolWindow layout XML sample I pasted below, save it to an XML file and load it in the Docking Sample.

TWLayout.xml:

(Note that the top right ToolWindowContainer is sized to a – quite normal – height of 264.)

<?xml version="1.0"?>
<!--

  Actipro Docking/MDI for WinForms
  Copyright (c) 2001-2024 Actipro Software LLC.  All rights reserved.
  http://www.actiprosoftware.com

-->
<ToolWindowLayout Version="1.0">
	<LayoutData>
		<HostContainerControl>
			<ToolWindowContainer Dock="Left" Size="291, 528" SelectedToolWindowGuid="2d0aa1ee-2681-4ad4-97c6-a77b88e1981d">
				<ToolWindow Key="Welcome to WinForms Studio" Guid="2d0aa1ee-2681-4ad4-97c6-a77b88e1981d" AutoHideSize="115, 133" DockedSize="285, 142" FloatingSize="0, 0" ImageIndex="2" Text="Welcome to WinForms Studio">
					<AutoHideStateInfo RootDock="Left" />
					<DockedInsideHostStateInfo RootDock="Left" IsAttached="False" />
					<DockedOutsideHostStateInfo IsAttached="False" />
				</ToolWindow>
			</ToolWindowContainer>
			<DockContainerContainer Dock="Right" Orientation="Vertical" Size="200, 528">
				<ToolWindowContainer Dock="None" Size="194, 264" SelectedToolWindowGuid="f27b120c-f1b5-4f23-86dc-2ab2390d5269">
					<ToolWindow Key="DockManager Properties" Guid="f27b120c-f1b5-4f23-86dc-2ab2390d5269" DockedSize="194, 383" FloatingSize="0, 0" ImageIndex="0" Text="Mgr Properties" TitleBarText="DockManager Properties">
						<AutoHideStateInfo RootDock="Right" />
						<DockedInsideHostStateInfo RootDock="Right" IsAttached="False">
							<DockedBy Guid="a25219b6-00d0-411b-9a84-36bc81997792" RootDock="None" DockOperationType="TopInner" IsTopMost="False" />
						</DockedInsideHostStateInfo>
						<DockedOutsideHostStateInfo IsAttached="False" />
					</ToolWindow>
				</ToolWindowContainer>
				<ToolWindowContainer Dock="None" Size="194, 258" SelectedToolWindowGuid="a25219b6-00d0-411b-9a84-36bc81997792">
					<ToolWindow Key="Tool Window Properties" Guid="a25219b6-00d0-411b-9a84-36bc81997792" DockedSize="194, 383" FloatingSize="0, 0" ImageIndex="0" Text="TW Properties" TitleBarText="Tool Window Properties">
						<AutoHideStateInfo RootDock="Right" />
						<DockedInsideHostStateInfo RootDock="Right" IsAttached="False">
							<DockedBy Guid="f27b120c-f1b5-4f23-86dc-2ab2390d5269" RootDock="None" DockOperationType="BottomInner" IsTopMost="False" />
						</DockedInsideHostStateInfo>
						<DockedOutsideHostStateInfo IsAttached="False" />
					</ToolWindow>
				</ToolWindowContainer>
			</DockContainerContainer>
		</HostContainerControl>
		<AutoHide Dock="Left" />
		<AutoHide Dock="Right" />
		<AutoHide Dock="Top" />
		<AutoHide Dock="Bottom" />
		<TabbedDocuments Orientation="Horizontal" />
		<FloatingContainers />
		<Hidden>
			<ToolWindow Key="Events" Guid="365e1ae6-7303-49bd-826b-93123fe0e5aa" State="DockableInsideHost" AutoHideSize="300, 300" DockedSize="200, 437" FloatingSize="0, 0" ImageIndex="1" Text="Events">
				<AutoHideStateInfo RootDock="Bottom" />
				<DockedInsideHostStateInfo RootDock="Bottom" IsAttached="False">
					<DockedBy Guid="2d0aa1ee-2681-4ad4-97c6-a77b88e1981d" RootDock="Left" DockOperationType="RightOuter" IsTopMost="True" />
					<DockedBy Guid="f27b120c-f1b5-4f23-86dc-2ab2390d5269" RootDock="Right" DockOperationType="LeftOuter" IsTopMost="True" />
					<DockedBy Guid="a25219b6-00d0-411b-9a84-36bc81997792" RootDock="Right" DockOperationType="LeftOuter" IsTopMost="True" />
				</DockedInsideHostStateInfo>
				<DockedOutsideHostStateInfo IsAttached="False" />
			</ToolWindow>
		</Hidden>
	</LayoutData>
	<CustomData />
</ToolWindowLayout>

[Modified 2 months ago]

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thank you so much for the excellent details and steps to reproduce.  Mixed monitor DPI's can certainly influence behavior, and is absolutely the key to this issue.

In this scenario, it appears having the window on the secondary monitor is causing a "DPI Change" to be triggered early, and this is causing a layout/arrange of the tool windows before they are fully initialized with their desired sizes.

We have the issue resolved for the upcoming 26.1 build. If you are working with an older version, updating to the latest release will ensure you receive this fix along with other improvements. Unfortunately, I don't see a way to work around this issue without the code change on our end. If you would like help getting set up on the latest version once that is out, please contact our sales@ address and we'll be happy to help.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.