Opening Form in WindowWorkSpace

Topics: CAB & Smart Client Software Factory
Feb 9, 2006 at 6:00 PM
originally posted by: sreeku

I want to open a Form in the WindowWorkspace. I am getting exception when I tried to open a form in the WindowsWorkSpace but it works fine when I use a smartpart control.

The following code throws error

mainWorkspace = new WindowWorkspace(this);
this.workItem.Items.Add(mainWorkspace, "MainWorkSpaces");
Form1 form = workItem.Items.AddNew<Form1>("id1");
WindowSmartPartInfo inf = new WindowSmartPartInfo();
inf.Title = "Control 2";
inf.ControlBox = true;
mainWorkspace.Show(form, inf);

Am I doing any mistakes here?
Feb 9, 2006 at 6:11 PM
originally posted by: DarrelMiller

Try converting your form into a user control and it should work fine. I'm not sure but I don't think the Window Workspace will handle forms.