Dock padding?

  • Thread starter Thread starter sklett
  • Start date Start date
S

sklett

I'd like to introduce a gutter or deadspace between my docked controls on a
form. I've sent the Form's padding to 5 for all, but the controls still
align right against each other. I could add a dummy panel between each one
set to a height/width of 5, but that is hacky. Is there another way that
people deal witih this? Is there a property that I'm missing somewhere?

Thanks for reading,
Steve
 
IIRC, "Padding" is the inner border /within/ a control; what you want
sounds closer to "Margin", but I don't believe this is respected for
tightly docked controls (e.g. 3 buttons right-docked together). The
margin certainly impacts the designer's "blue bar cue thingies" (sorry,
name escapes me at the moment).

You could try anchoring? E.g. to simulate a right-dock with Margin,
place where you want, expand until the blue bars kick in, then (for
right-dock) anchor Top | Right | Bottom.

Marc
 
sklett said:
I'd like to introduce a gutter or deadspace between my docked controls on a
form. I've sent the Form's padding to 5 for all, but the controls still
align right against each other. I could add a dummy panel between each one
set to a height/width of 5, but that is hacky. Is there another way that
people deal witih this? Is there a property that I'm missing somewhere?

Thanks for reading,
Steve

In addition, if I'm not mistaken, when you set the Dock padding for the
form, for example, the padding only affects how controls dock to the
form and not to each other. I think what Mark posted should help you.

Another way to control layout of controls is to use the
TableLayoutPanel and/or the FlowLayoutPanel (assuming you have
VS2005). These controls use the same techniques that are common on web
pages to control layout.
 
Back
Top