locked
Margin doesn't work with docking? RRS feed

  • Question

  • I tried to search but couldn't come up with an answer.

    I have 2 controls that both dock to the top.  I want to set a margin in between those 2 controls but setting the margin on that individual control has no effect.
    Tuesday, August 19, 2008 2:27 PM

Answers

  • You can try to add a FlowLayoutPanel to your form first. Dock that. 

    Then add your controls to the FlowLayoutPanel.  Adjust the sizing between each control using f.e. the Margin property of each control.

     

    - terje

    Wednesday, August 20, 2008 8:10 PM

All replies

  • Try experimenting with the Padding property instead of Margin.

     

    If all else fails, dock an empty Panel between the two controls.

     

    Wednesday, August 20, 2008 12:43 AM
  • Padding doesn't work as well.  I want to avoid the empty panel approach, just wonder if this behavior is by design or there is something else went wrong.
    Wednesday, August 20, 2008 1:57 PM
  • You can try to add a FlowLayoutPanel to your form first. Dock that. 

    Then add your controls to the FlowLayoutPanel.  Adjust the sizing between each control using f.e. the Margin property of each control.

     

    - terje

    Wednesday, August 20, 2008 8:10 PM