StandardMDIBounds and DocumentWindows

Docking/MDI for Windows Forms Forum

Posted 11 years ago by Miriam Kuruvilla
Version: 2.0.0105
Avatar
I load multiple document windows with DocumentMdiStyle = Standard. When i reopen the application I want to reload the document windows with the same size/position.

I did not find anything equivalent to the GetToolWindowLayoutData() that can be used to set the layout data for DocumentWindows - presumably because the DocumentWindow lifecycle ends when it is closed?

I have set DockManager.StandardMDIAutoWindowLayoutEnabled = false.
I am trying to use the DocumentWindow's StandardMdiBounds property to set the size and position.

this.StandardMdiBounds.X = initLeft;
this.StandardMdiBounds.Y = initTop;
this.StandardMdiBounds.Width = initWidth;
this.StandardMdiBounds.Height = initHeight;
I run into compiler errors as follows:
Cannot modify the return value of 'ActiproSoftware.UIStudio.Dock.TabbedMdiWindow.StandardMdiBounds' because it is not a variable

However I am able to change the values from the properties dialog.
Any suggestions?

Thanks.
Miriam

Comments (2)

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

Yes that error is correct based on your code. Since Rect is a struct and structs are immutable, you can't do that like you could if Rect was a class.

Instead do this:
this.StandardMdiBounds = new (initLeft, initTop, initWidth, initHeight);


Actipro Software Support

Posted 11 years ago by Miriam Kuruvilla
Avatar
Thanks! I had figured it out after staring at it for a while :)

[Modified at 12/10/2008 03:34 PM]

[Modified at 12/10/2008 03:39 PM]
The latest build of this product (v2018.1 build 0341) was released 8 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.