I am attempting to move from using a standard windows TableLayoutPanel to using a GridBagLayoutPanel as I have a resizable screen and the redraw for the TableLayoutPanel is quite flickery
My problem is that when using the GridBagLayoutPanel, the first rows height is smaller than the rest.
Each control in the panel has had its Origin, Span and weight values input and double checked with great care.
The Panel has a 5x5 matrix layout and there is a mixture of spanning values. all the controls are in their correct position.
Hi,
Did you set properties "ExpandToFitHeight" and "ExpandToFitWidth" = true ? Please if you have possiblity send us small exapmle with this problem, because I can`t simulate your problem.
Please keep me in touch.
Best Regards
Georgi
Hi Georgi
I had set the Expand Properties to true.
I went back to using the table layout panel, so I just set the form back up again using the gridlayoutpanel again and guess what... Its all proportional and correct.
I spent half a day trying to get it laid out properly! wind up.
Can you tell me if there are any plans to create a control that lets you lay the components out in a grid like the TableLayoutPanel, as the GridBagLayout panel is very fiddly if you have a lot of controls?
I don't know of any plans to create a TableLayoutPanel, but we do have the UltraSplitter control. So you could use that to set up your controls on a form and allow the user to resize them.
For future reference, the PreferredSize will be set any time you resize a control in the Panel at design-time. So you must've sized the control at some point while you were arranging the controls in the panel.
I have just worked out what was distorting the layout
the GridBagLayout.PreferredSize property - zero it out and everything goes back into shape