mdi workspace childforms loaded but not visible

Topics: CAB & Smart Client Software Factory
Dec 14, 2005 at 2:11 AM
originally posted by: LievenBoving

Hi,
I've created a shell with ShellForm a deckworkpace on the right side and a custom workspace on the left side.
I have deleted my deckworkspace and set my form to ismdicontainer.
In the Aftershellcreated i've added an mdiworkspace.
like this.

RootWorkItem.Workspaces.AddNew<MdiWorkspace>("MDI");

I my workitems i call the just do the following

if (parentWorkItem.Workspaces.Contains("MDI"))
myWorkItem.Run(parentWorkItem.Workspaces"MDI");

public void Run(IWorkspace window)
{
IMyView view = this.Items.AddNew<MyControl>();

WindowSmartPartInfo info;
info = new WindowSmartPartInfo();
info.Title = "Test Window";
info.Width = 100;
info.Height = 500;
MyPresenter presenter = new MyPresenter(view);
this.Items.Add(presenter);
info.Modal = true;

window.Show(view,info);
}

}

This is the way i follow to show mdi child forms in my main form
However i do not understand how the mdi workspace knows what is his parent form.
The code does not crash but my child form is not visible.

Any help would be very nice..
Dec 24, 2005 at 8:15 PM
originally posted by: KristianPaul

When creating your MDI workspace, you need to specify the form to be used as the MDI parent.

Dim mdi As New MdiWorkspace(MyBase.Shell)
RootWorkItem.Workspaces.Add(mdi, "MDI")