Scrolling in ToolWindowContainer

Docking/MDI for WPF Forum

Posted 11 years ago by Roland Wallin
Version: 13.1.0581
Avatar

Hi,

I have a ToolWindowContainer that I add ToolWindows to dynamically from code.

New ToolWindows added will be placed in the container with their full size if the window is large enough, and if the window isn't large enough it will be resized to a smaller size.

I want to have a ToolWindowContainer with a scrollviewer, so that new ToolWindows are added at their original size, and the container displays a scrollbar when the size overflows.

Is this possible? If possible, how do I do it?

Comments (3)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Roland,

It concerns me that based on what you said, you might not be using the docking windows API properly.  For instance, you should never reference any containers in code, since they dynamically get created/destroyed based on layout changes.  Instead, you want to use methods described in the documentation like ToolWindow.DockTo to programmatically build up a layout.  The first tool window you could DockTo the side of the DockSite.  The ones after that, if you wish to have them be "tabbed", you could DockTo the first tool window and use the "attach" dock mode.

The proper place for ScrollViewers is in the content of the tool window.  ScrollViewers are often the best root element for your tool window content.  That way if the tool window resizes too small for its content, the user can still get to everything by scrolling.

You can use the DockSite.ControlSize attached property to try and indicate a desired size for a tool window before it enters the layout, although it might only work on the tool window that first creates the tool window container.  Also, you can programmatically resize SplitContainers that get created (see our Programmatic Sizing QuickStart), which might help you more for your scenario.


Actipro Software Support

Posted 11 years ago by Roland Wallin
Avatar

Thanks!

I'll change the layout-building code to work as described.

However, the problem is not that the content in the ToolWindows isn't scrollable. I want to have a scroll in the container, that scrolls the available ToolWindows. I want the ToolWindows to have a specified initial size, and a scrollable container for them. One scrollable container with multiple toolwindows.

Programmatic sizing only helps to make the toolwindows have the right initial size, it doesn't help to get a scrollviewer in the container itself.

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

Hi Roland,

Sorry but I'm still not quite sure of how you want it to end up looking.  Could you mock up a screenshot or two and upload them somewhere for us to see?

There are two places you can use a ScrollViewer with the tool windows.  One would be inside of each tool window's content area, which is normally done.  The second would be to surround the entire DockSite with a ScrollViewer, but in my opinion, that doesn't make the Docking system as usable.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.