Joerg Jooss <(E-Mail Removed)> wrote:
> > Great - thanks for the extra detail. Do any of them specifically
> > cover layout in any great detail?
>
> Petzold and Brown just explain the Anchor and Dock properties. MacDonald
> goes a little further here and describes typical layout scenarios.
Right.
> > This book-buying idea came about
> > when I failed to find a simple way of creating a form which
> > contained three GroupBoxes which should be laid out vertically to
> > their "natural" size, preferrably without me having to do much
> > explicit size specification.
>
> Hm. What about docking three Panels (DockStyle.Top, .Fill, .Bottom) and
> placing one GroupBox in each?
I suspect I could actually just dock the three group-boxes themselves,
yes. But do I need to specify the size of the top and bottom ones, or
will they be magically the natural size?
(Also, I could do with making it non-resizable, as it won't make any
sense to resize it - I haven't found any way of doing that other than
by making the maximum and minimum size the same, and even that doesn't
stop the user from *trying* to resize it. I'm sure I've just missed
something there.)
> > I don't do much GUI programming in any language/platform, but in Java
> > this would be fairly easy to do - it so far it seems it's a bit of a
> > pain in .NET, which probably means I've missed something important.
>
> There are no LayoutManager classes in Windows Forms like the ones found
> in AWT or Swing; instead, each Control has the aforementioned Dock and
> Anchor properties that control resizing behavior. Did you try them?
I've tried them briefly, but as far as I can see they only give a
fairly coarse level of control compared with the Java layout managers,
in terms of how much space is given to each control when the form is
resized, etc. I'm sure I'll get more used to them - I can just see
myself creating more panels solely because I can't easily have more
than three things vertically or horizontally stacked, etc. That's okay
though - it's just a change in paradigm.
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too