views:

266

answers:

3

I use Delphi 2007 in my daily work and have now start to look at VS2008 and C#. One confusing thing compared to Delphi is the design editor in VS.

Here is the Form Designer in Delphi

Layout hierarchy in Delphi

As you see on the left I have a hierarchy of components. Some of them like TPanel and TGroupbox can contain other components. It is very easy to change a parent just by dragging and dropping in the tree view.

Compare this with VS that has a flat structure. How can I reorganize the layout of components in VS? Is it something I have missed?

Regards

+1  A: 

In this case there is no difference between Delphi and C#. Even in C# you can embed controls in a groupbox or a panel. I don't think Visual Studio has the same Structure panel that Delphi has but that same hierarchy exists when you create that form.

EDIT: It's called "Document Outline" and you can find it under the menu View -> Other Windows -> Document Outline. Or press CTRL + Alt + T while in design mode.

ZippyV
It's not a question of whether controls can have child controls. Does VS have a design-time view that **shows** the parent-child hierarchy? And if it does, can you use that to **change** the parent-child hierarchy like you can in Delphi? (In the image above, you can drag the items in the tree view to change controls' parents rather than moving them around in the Form Designer.)
Rob Kennedy
It is really strange. I have asked this question before of a guy experienced in C# and he also didn't really understand me. He didn't think this was a big issue. But it is for me. I think Delphi have a real smart solution for this and I just expected that VS have something similar. Obviously I was wrong...
Roland Bengtsson
I found it. It's called "Document Outline" and you can find it under the menu View -> Other Windows -> Document Outline. Or press CTRL + Alt + T while in design mode.
ZippyV
+2  A: 

There's 3rd-party support, as google told me: http://www.telerik.com/products/winforms/tools.aspx. Which probably means that VS doesn't support this out of the box ;-) Not sure if it allows to move between parents, though.

queen3
+1  A: 

Are you looking for something like the Source Code Outliner PowerToy??

alt text

Or if you're a CodeRush user and have the DXCore installed in your Visual Studio, you could also check out DX_SourceOutliner instead.

marc_s
Does it also provide an outline for the layout of the form's controls, like the picture in the question? Can you change the declaration order of methods and fields by moving things around in the outline?
Rob Kennedy
Ah, sorry -yes, that's even built-in: if you're on a Winform, go to "View > Other Windows > Document Outline" - that should do the trick
marc_s
Thanks for the reply, but this was not obvious. I should call it Component layout or something.
Roland Bengtsson