Docking questions - I don't get it

Topics: CAB & Smart Client Software Factory
Feb 12, 2007 at 9:09 PM
This may actually be a VS 2005 question, not a CAB/SCSF question, but I'll put it here anyway :-)

I've created my shell including infrastucture.layout and my modules that have views that go into the shell's workspace...

Now I'm trying to customize the layout workspace and it is frustrating me. There is a shared MenuStrip, ToolStrip, and StatusStrip, and a SplitContainer, just as they were created by the recipe. But I just want move the ToolStrip to the bottom, above the StatusStrip, rather than at the top, below the MenuStrip.

I changed its "Dock" property to "Bottom". This property is now shown in bold for some reason, and it is now under the status tool strip. Since both are set to dock at the bottom, how am I supposed to specify which is above the other? Somehow the recipe set both the menuStrip and toolStrip to dock at the Top and display in the proper order... But I don't know how...

After moving them around more, I eventually got it to look right, but the SplitContainer was actually taking up the whole ShellLayoutView, and the StatusStrip and Toolstrip are hiding the bottom of this one. With just the Dock property to work with, I have no idea how to take more control over their order, or even to understand how one is now on top of the other, when each is told to Dock somewhere. Maybe I cut/pasted it wrong... I'll start from scratch again...

Any words of wisdom out there? I can post code if you like, or you can just create a new project Smart Client Application, select to create a separate layout view, and then go try to get the toolStrip under the splitContainer and above the StatusToolstrip yourself :-)
Feb 12, 2007 at 9:19 PM
Well, once you post something, that always helps one to solve their own problem...
Since they are both docked at the bottom, I looked in ShellLayoutView.Designer.cs, in the part I'm not supposed to modify myself. Near the bottom of private void InitializeComponent() the controls are added to the view one by one. I saw that the statusStrip was added first, then the toolStrip. So perhaps if I just cut that line and pasted above, so the toolstrip gets added first...

Wouldn't you know it, it was that easy.

There should be some better way than editing the code we're not supposed to touch, though, don't you think?
Feb 13, 2007 at 4:47 PM

I have had problems with this also, dang docking!! I used to solve this, when using the designer, by selecting the different items and select "SendToBack", "BringToFront", ect... But now I have found a view called "Document Outline" which outlines just that, which control is in front of which. Just a FYI since it has to do with docking and which item is on top of which item.

Feb 13, 2007 at 6:56 PM
Edited Feb 13, 2007 at 7:02 PM
Hi, bbiales,

I do not use SAF, instead we just use CAB. But sounds to me, this is not an issue of CAB. Please try to add a ToolStripContainer to the form (dock it), now you can move the top ToolStrip to the 4 ToolStripPanel at the 4 side edges(Even at run time).

If you do not like a ToolStripContainer, any IContainer extending class will work this way, please composite the UI samilar to this:

1. Add a panel to the form, dock to fill.
2. Add other control to the panel, then set dock

Hopeful this could be help. Good luck.