How to set the size of SplitContainer?

Docking/MDI for WPF Forum

Posted 9 years ago by zhouxu
Version: 10.1.0523
Avatar
Hi,
I have the following code:

<docking:SplitContainer Orientation="Horizontal">
<docking:ToolWindowContainer>
...
<docking:ToolWindowContainer/>

<docking:Workspace>
...
<docking:Workspace/>
</docking:SplitContainer>

And I want to set the initial with of toolWindowContainer and Workspace to 20% and 80% of the entire width. How can I do it? Thank you!

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

Currently, you can only perform percentage based sizing by leveraging the SplitContainer.ResizeSlots method. The Programmatic Resizing QuickStart shows an example that favors the Workspace. Specifically, then method OnLayoutEvenlyDistributeFavorWorkspaceMenuItemClick will calculate ratios that give the Workspace more room. You should be able to use a similiar method in your code when loading. You can also alter the ratios to be 2 and 8, instead of 1 and 3.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.