WinForms: creating a set of vertical controls

I have a Windows form that displays several DataGridViews in the following layout:
(There is no access to image hosting at work, so please apologize for the ASCII art ...)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  
β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚  
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚                          β”‚β”‚
|β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚                          β”‚β”‚
|β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Unfortunately, when the user resizes the form above, the form ends as follows:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  
β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚  
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚                          β”‚β”‚
|             |                          ||
|             |                          ||
|β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚                          β”‚β”‚
|             |                          ||
|             |                          ||
|β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Instead of this:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  
β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚  
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚                          β”‚β”‚
|β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚                          β”‚β”‚
|β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β”‚           β”‚β”‚                          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

To reproduce this, bind the upper left DataGridView to the upper left edge, the left to the left of the DataGridView and the left lower left of the DataGridView left-up and the large DataGridView to all 4.

What can I do to get the right behavior?

+3
source share
2 answers

TableLayoutPanel , stlye "fill", TableLayoutPanel , .

+6

SplitContainer Panel GroupBox. .

0

Source: https://habr.com/ru/post/1746903/


All Articles