How to provide some vertical space between Docked text boxes

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!
 
B

Bert Hyman

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.
 
K

Kevin P. Fleming

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.
 
N

N4709L

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top