How to provide some vertical space between Docked text boxes

  • Thread starter Thread starter N4709L
  • Start date Start date
N

N4709L

I'd like to have several Textbox controls stacked vertically within a panel.
Each Textbox will have its .Dock property set to Top. This enables all of
the Textbox controls
to resize as the panel resizes, which is the effect I'd like.

However, since each Textbox has its .Dock property set to Top, the Textbox
controls have no space between them. I'd like to have some space between the
Textbox controls. How can this be easily achieved? Or should I be satisfied
that the Textbox controls have a common top and bottom edge?

What I am trying to achieve is a vertically stacked set of Textboxes, with
some vertical space between them, that will automatically resize in width as
the panel changes width.

Thanks!
 
In "N4709L"
However, since each Textbox has its .Dock property set to Top, the
Textbox controls have no space between them. I'd like to have some space
between the Textbox controls. How can this be easily achieved?

Just put another control between them, also Dock.Top. A blank label would
work, or if you want to get sexy try a splitter.
 
N4709L said:
What I am trying to achieve is a vertically stacked set of Textboxes, with
some vertical space between them, that will automatically resize in width as
the panel changes width.

Then you don't need Dock at all, you just need to anchor the Textboxes
to the left and right edges of their container (the Panel). They will
then resize as the panel is resized.
 
Using anchor instead of dock is a much better way to achieve the automatic
resizing and positioning that I desire. Thanks for the tip!
-Ron
 
Back
Top