window workspace, precise window properties

Topics: CAB & Smart Client Software Factory
Jul 4, 2006 at 6:35 AM
originally posted by: pmelichar1809

How can I specify window parameters like StartPosition or FormBorderStyle when I am displaying smartpart in a WindowWorkspace. I think there is no such WindowSmartPart property. Please help.

Petr M.
Jul 11, 2006 at 4:41 AM
originally posted by: juemue

Hi Petr.

Use a WindowSmartPartImfo object on your control. There you find the properties.
This object is used by the Workspace to show your window.


Aug 3, 2006 at 2:01 AM
originally posted by: pmelichar1809

Yes, I use WindowSmartPartInfo object, but there is not enough properties. For example can you advise me the easiest way how to display user control in screen centered, dialog window, with FixedSingle border stile (using window workspace), Now I need to count position etc. ...
Aug 3, 2006 at 2:18 AM
originally posted by: juemue


in this case you have to extend the functionality of both, WindowSmartPartInfo and the WindowWorkspace.
But don't modify those classes, but create two new classes and use WindowSmartPartInfo and WindowWorkspace
as templates (look into the sources).


Aug 7, 2006 at 6:21 PM
originally posted by: Arun_Shivasankaran

Hi, You are right WindowSmartpartInfo doen't provide enough property as the Form gives.
You can get the Form using windowWorkSpace.Windowcontrolkey
I have added some code

windowWorkSpace = new WindowWorkspace();
smartpart = workItem.Items.AddNew<UI>("ID");
windowWorkSpace.Windowssmartpart.StartPosition = FormStartPosition .CenterScreen

Arun Pattali Shivasankaran.
Oct 14, 2006 at 3:03 AM
originally posted by: pmelichar1809

this does not work because the window is already shown after windowWorkSpace.Show(smartPart);, so there is no meaning set startposition after this...

nobody need this? all of you are counting x,y coordinates?

Nov 17, 2006 at 7:58 AM
originally posted by: AndrejJ

I ended up by extending WindowSmartPartInfo and the WindowWorkspace (as juemue noted above) from SCSF, by a StartPosition property. It works fine, but note, that CenterToParent doesn't work if a non-modal window is needed. I think it is problem of WindowsForm's Show(owner) vs ShowDialog(owner) calls.
The next problem for some custom positioning of WindowWorkplaces is that WindowWorkspace.cs within the CAB calls form.Location = info.Location even if SmartPartInfo.Location is empty. This causes window flickering in some situations.