Reset the Layout on the DockManager

Docking/MDI for Windows Forms Forum

Posted 14 years ago by jimmer - Somerset, UK
Avatar
I am saving the layout of the dockmanager using

SaveToolWindowLayoutToFile and subsequently LoadToolWindowLayoutFromFile which is working really well. The question I have is how to reset the layout once it has been loaded onto the form. ie disregard the layout file.

Can you let me know if this is possible

Thanks

Comments (7)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You can use the DockManager.CloseAllActiveToolWindows method to close out all the tool widnows, thereby removing the layout.


Actipro Software Support

Posted 14 years ago by jimmer - Somerset, UK
Avatar
Ok, so basically I need to close the windows and reload as required.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes, that's it.


Actipro Software Support

Posted 14 years ago by jimmer - Somerset, UK
Avatar
That works almost as expected, however all the items when activated resume in the positions that they were left in. I need to load them so that they are displayed in their default positions (ie when the system first loads). Am i doing something wrong?
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Right the method I gave you will simply close them all but not update dock positions.

By default positions do you mean how they were in the designer or just when you programmatically create new windows?


Actipro Software Support

Posted 14 years ago by jimmer - Somerset, UK
Avatar
As they are in the designer.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
For that you'd have to save a separate layout file. You can even do it on your end by running the app and saving the layout and including it as a manifest resource in your assembly. Then load it whenever you need to. That will keep your original layout always available to end-users and will have the effect of loading everything like it was originally designed by you.


Actipro Software Support

The latest build of this product (v2020.1 build 0400) was released 7 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.