Getting the shell from a work item

Topics: CAB & Smart Client Software Factory
Apr 20, 2007 at 10:51 AM
Edited Apr 20, 2007 at 10:52 AM
Is it possible to get hold of the shell and the main window from a work item? I would like to have a modal dialog appearing on top of the main window.
Apr 20, 2007 at 11:26 AM
You could use for this MDIWorkspace that SCSF create as default:

Apr 20, 2007 at 3:48 PM
It's possible. You can do something like this in the ShellApplication, in the overridden AfterShellCreated() method:

RootWorkItem.Items.Add(Shell, "Shell");

Or you could do as suggested above and use the WindowWorkspace.

Or you can simply set the form(dialog) StartPosition to CenterParent. Even without a reference to the Shell this should work (works for us).