Layout of Mdi forms is not retained

Docking/MDI for Windows Forms Forum

Posted 19 years ago by Domenico
Avatar
If I have a layout with some toolwindows in Mdi style (floating, not tabbed), save the layout then reload it, these toolwindows retains the style, but not position or size. This happens also if you simply close one of these toolwindows then reopen it.
This behaviour can be seen also on your sample.
I'm using the last version of UIStudio.

Best regards

Comments (11)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Domenico,

Right now we are letting the .NET framework control where standard MDI windows display, so by default it tiles them. If you'd like the position and size saved, should this information be persisted to layouts or do you just want it to work if they hide a tool window and then redisplay it within an application session?


Actipro Software Support

Posted 19 years ago by Domenico
Avatar
Sorry, but I don't understand well your question.

I'd like that the position, size and windowstate of each Mdi form (both document or toolwindow) should be:
- saved/restored in/from the layout file.
- saved if I close/dock/float/hide the form and restored when I redisplay the form in Mdi style.

It would be great if those properties will be preserved also when the form is not in Mdi state, so I can:
1) Position and resize an Mdi form;
2) Set it to close/dock/float/hide state;
3) Save the layout and close the application;
4) Reopen the application and reload the layout;
5) Set the form back to Mdi style, and having back the situation in point 1.

At the moment I'm trying to implement these features by myself. I don't know how to determine when a toolwindow changes style to/from Mdi. The event Form.MdiChildActivate is too generic to be useful. Any ideas?

Thanks
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok we've just built in new features to support this for the next maintenance release:
- Added the TabbedMdiWindow.StandardMdiBounds property to control the bounds of windows when in standard MDI mode.
- Added the DockManager.StandardMdiAutoWindowLayoutEnabled property to control whether new windows displayed in standard MDI mode are automatically positioned or are positioned using their TabbedMdiWindow.StandardMdiBounds property value.

Those two things should get it working for you.


Actipro Software Support

Posted 19 years ago by Domenico
Avatar
Thank you very much. It's a pleasure to work with someone so quick and kind.
When the next maintenance release will be available?

Thanks again
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Probably very soon... we have a ton of updates including modifying the dock UI to match the RTM release of VS.NET 2005.


Actipro Software Support

Posted 19 years ago by Domenico
Avatar
These bounds are preserved when saved/loaded to a layout file (using the methods DockManager.SaveToolWindowLayoutToFile and DockManager.LoadToolWindowLayoutFromFile) and accessible through the property DockManager.ToolWindowLayoutData ?
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes exactly and if you set the TabbedMdiWindow.StandardMdiBounds at run-time it modifies the bounds of the Form directly.


Actipro Software Support

Posted 19 years ago by Domenico
Avatar
Great! I'm waiting for the next maintenance release now!

Thank you very much
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The next maintenance release is going to be pretty big. It's getting dragged out a little longer because we are also improving some things with the renderers, updating Shared/WinUICore with new features, and trying to work in a solution to another issue. We'll try and get it out as soon as possible though.


Actipro Software Support

Posted 18 years ago by Anthony Martin
Avatar
I'm having an issue with the MDI Forms. I have the same problem as above. I've set StandardMdiAutoWindowLayoutEnabled to true and can see that all the StandardMdiBounds are set when I save the layout. However when I re-load the layout, the windows are all tiled. Am I missing a step?
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually, you want StandardMdiAutoWindowLayoutEnabled to be false to prevent the auto-layout. If it is false it will use your StandardMdiBounds.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.