StandardMDIBounds and DocumentWindows

Docking/MDI for Windows Forms Forum

Posted 16 years ago by Miriam Kuruvilla
Version: 2.0.0105
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?


Comments (2)

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

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 16 years ago by Miriam Kuruvilla
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 (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.