Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How can I layout group boxes with TableLayoutPanel?

Group boxes tend to have similar behavior to dialogs except that they contain fewer controls. Also, many group boxes will be required to grow vertically with font changes and still stretch with the form. The below example has a TableLayoutPanel inside a group box. The Group Box has its padding set to 0 all around and the TableLayoutPanel has a margin of 9 all around.

A single absolute column style in this table layout panel restricts the width of the rest of the contents and allows the font to wrap. Also, this way we can anchor the table layout panel top, left and right so the contents will stretch with the groupbox.



Page view counter