SplitContainer, resize & ResizeSlots

Docking/MDI for WPF Forum

Posted 8 years ago by Steve py
Version: 10.2.0531
Platform: Windows Forms Controls
Environment: Windows XP (32-bit)
Avatar
I was reading up on how to specify a size for a SplitContainer and tried a ResizeSlots() call from code-behind. This doesn't appear to be working in cases where an application starts up with ToolWindowContainer a Workspace containing an empty TabbedMDIHost. I specified a call to ResizeSlots(1,3) Expecting the tool window container to take 1/4 of the space. It resizes, but takes 1/2. I've tried various different settings and it always takes half.

XAML
<docking:SplitContainer>

<docking:SplitContainer x:Name="uxSplit" Orientation="Horizontal" >

<docking:ToolWindowContainer>
<docking:ToolWindow x:Name="uiMenu" Title="Menu">
<domain:UIMenu MortgageSelected="UIMenu_MortgageSelected"></domain:UIMenu>
</docking:ToolWindow>
</docking:ToolWindowContainer>

<docking:Workspace>
<docking:TabbedMdiHost x:Name="tabbedMdiHost" TabPlacement="Bottom">
<docking:TabbedMdiContainer x:Name="uxContainer">
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>

</docking:SplitContainer>
</docking:SplitContainer>

Windows are added to the MDI container programatically based on navigation controls. (UIMenu)

I did find a work-around mentioned in other posts that worked for anyone having similar issues. I added docking:DockSite.ControlSize="300,100" to the ToolWindowContainer to force it to a width of 300. (The height of 100 is ignored since it's docked)
...
<docking:ToolWindowContainer docking:DockSite.ControlSize="300,100">
...

Still, I'd expect the call to ResizeSlots to work even if there is no active document or tool window in the secondary pane.

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Steve,

If you call ResizeSlots before the SplitContainer is completely loaded, then it may not work. You may try dispatching the call, so it's guaranteed to occur after the SplitContaier is finished setting up.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.