How to show new window in CAB?

Topics: CAB & Smart Client Software Factory
Sep 12, 2006 at 6:47 AM
originally posted by: dsazonov

I need t oshow new window, which must not be modal and must show itself in taskbar. It basically must be new WinForm.

I wanted to use CAB for that and tried to use standart WorkspaceNames.ModalWindows:

AlertView view = WorkItem.SmartParts.AddNew<AlertView>("AlertView");

The problem is: this window is always topmost and it doesnt show itself in taskbar.
I tried to use WindowSmartPartInfo to control windows behaivour, but was I only able to set windows icon. Propertied like ShowInTaskBar, StartPosition, etc just doesn't exist in WindowSmartPartInfo.

Question: how can I show my smartPart in "normal" winform? what workspace is responcible for that? Should i just forget about CAB and create my own form?
Sep 13, 2006 at 2:21 AM
originally posted by: atmchuck

Are you trying to create an MDI Sheet Form? I ask that, because you make a refernce to wanting the form to show up in the task bar. I'm not sure what you mean by that.

In order to open up a View in a Form, you need to specify a Workspace. You've obviously found the ModalWindow workspace. If you want a different type of Workspace, then you need to be sure that this type of workspace has been created.

In my application, I was also trying to open a View in an MDIClient workspace. However, I ended up using the Outlook Bar, which did not fit with an MDI user interface in our application.
Sep 13, 2006 at 3:34 AM
originally posted by: dsazonov

No, I just want to open new window. Imagine MS outlook: it has mai nnavigation window but you also can open your e-mail in separate window. New window opening when you hit reply as well. Each such "letter window" showing itself in taskbak and it does not behaive as topmost window, it is just as normal as you can get.

this is what I need and apparently CAB does not have such workspace. I have to create my own WinForm, add deck workspace onto it and do it for each different window I need to create, which is sad.

for you... did you ended up using deck workspace?
Sep 13, 2006 at 4:14 AM
originally posted by: gcole

Check out the WindowWorkspace. It's not in the toolbox, you have to create it in code:

//create a generic child work item
WorkItem child = this.WorkItem.WorkItems.AddNew<WorkItem>();

WindowWorkspace mWindowWorkspace = new WindowWorkspace();
WorkItem.Workspaces.Add(mWindowWorkspace, WorkspaceNames.VmMainWorkspace);

VendorManagerLayoutView view = child.Items.AddNew<VendorManagerLayoutView>();
view.Dock = DockStyle.Fill;

mInfo = new WindowSmartPartInfo();
mInfo.Modal = false;
mInfo.Title = "Vendor Manager";
mInfo.Width = 1100;
mInfo.Height = 700;
mInfo.Location = new Point(100, 100);

mWindowWorkspace.Show(view, mInfo);
Sep 13, 2006 at 4:24 AM
originally posted by: atmchuck

Sorry, I misunderstood when you said, "Taskbar". I was thinking Toolbar/Menubar.

We are struggling with the same UI issue. Our users claim that they want Outlook, but are also asking for MDI, which doesn't seem to make sense. As you correctly point out, Outlook opens these new forms (Views in the CAB) as what appears to be a separate application. For example, if you open the Contacts in Outlook, and doubleclick on a Contact, it opens a Contact as a separate Form, which is visible on the Taskbar(as you stated in your original post). If you then close Outlook, the Contact Form stays open, so it is not an Child of the Shell Form, nor a MDI Sheet.

I'll be glad to share any answeres on how we eventually solve this.
Jan 31, 2007 at 8:22 AM
I want the same behavior like new mail in Outlook, it’s the same behavior s that you talk about here.
With the code you show its work fine but I don’t get the form to be in the center of the screen. I try this:

WindowSmartPartInfo mInfo = new WindowSmartPartInfo();
mInfo.Modal = false;
mInfo.Title = "Vendor Manager";
mInfo.Width = 1100;
mInfo.Height = 700;
mInfo.MinimizeBox = true;
mInfo.MaximizeBox = true;
mInfo.KeysWindowWorkspaceSetting.FormBorderStyle = FormBorderStyle.Sizable;
mInfo.KeysWindowWorkspaceSetting.FormStartPosition = FormStartPosition.CenterScreen;
// mInfo.Location = new Point(100, 100);

mWindowWorkspace.Show(view, mInfo);

If I set mInfo.Modal to true its work but I don’t wont the form to be Modul.
Any suggestion?
Apr 18, 2007 at 9:53 PM
I have a outlookbar workspace in the left and deckworkspace in the right created using SCSF.

Users expect multiple windows to be shown.I am able to show multiple windows,when minimized the windows are getting minimized to the left hand corner of the application.But i am not able to show the windows getting minimized on the taskbar.

My question is
How to show a new window which on creation has a reference in Taskbar,so that when user wants to minimize the new window the window would get minimized to a Taskbar?