Default positions of new toolwindow's

Docking/MDI for Windows Forms Forum

Posted 18 years ago by Justin Stenning - Manager, Research & Development, Pty Ltd

I'm trying to work out how the following would work.

Say I have loaded a form, displayed some toolwindow's for the first time, rearranged and then closed the app. During the close I save the layout.

During the open of the app the layout is then loaded, and the toolwindow's are displayed as defined by their previous configuration.

I now want to show a new toolwindow, as a result of some user selection, on the left but underneath any existing toolwindow's already docked there - or even by Attaching them to make them tabbed.

My question is, how do I know which of the other toolwindows I need to DockTo? I have no idea how to determine what toolwindows are on the left (if any in which case i would DockTo the dock manager right?).

Sorry if this is a repeated question, I tried searching through the forum and was unable to find anything that was quite right (as with the documentation).


Comments (2)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Justin,

Each ToolWindow has a ToolWindowContainer property. If you look at that (if it is not null), the ToolWindowContainer (as do any DockContainer-inherited classes) have a RootDock property which indicates the side upon which the container is docked. You can iterate upwards through DockContainers by using their Parent property.

The DockContainer class is abstract. But the inheriting classes for DockContainer that you will be interested in for docked tool windows are either ToolWindowContainers or DockContainerContainers. ToolWindowContainers only contain ToolWindow objects and are what display the title bars and tabs (if needed) for tool windows. DockContainerContainers hold one or more other DockContainers in either a horizontal or vertical layout. So by recursively iterating through the control hierarchy of DockContainers you can determine what is where.

Hope that helps.

Actipro Software Support

Posted 18 years ago by Justin Stenning - Manager, Research & Development, Pty Ltd
I had begun to think this might be the case after I took a look at the layout XML.

Thanks for the help.
The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.