originally posted by: mylesmacrae
I've seen this question posted a couple of times, but have never seen an answer. Using the mdiworkspace, how do oyu specify the layout of child windows/smartparts as they are created. At present, they always get put in the top left hand corner.
originally posted by: matiaswoloski
The IWorkspace interface exposes a Show method that accepts an ISmartPartInfo.
Each type of Workspace has its own ISmartPartInfo. For example, the TabWorkspace uses the TabSmartPartInfo which has a Position property and a Name for the TabPage to be added. That's the way to pass the additional information.
The MdiWorkspace accepts a WindowsSmartPartInfo. This smart part info has these properties:
When you show a smartpart on the MdiWorkspace you do it like this:
WindowsSmartPartInfo info = new WindowsSmartPartInfo();
info.Location = new Point( 10, 100); // location is relative to the container
Workspaces"Mdi".Show( myView, info );
originally posted by: njjones
I too have been struggling with getting the child forms to be displayed any where other than the top left of the parent window.
IWorkspace startMDI = new MDIWorkspace(mainForm);
MyView mdiChild = this.Items.AddNew<MyView>("Start");
private WindowSmartPartInfo StartWindowInfo()
WindowSmartPartInfo info = new WindowSmartPartInfo();
info.ControlBox = false;
info.Location = new System.Drawing.Point(100, 150);
info.Height = 300;
info.Width = 500;
I don't see anything that I'm doing wrong... Any help is much appreciated!