Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control proportions different between runtime and designer

Tags:

c#

winforms

i'm currently modifying an existing C# WinForm project. I try to arrange some controls inside a GroupBox. However on runtime, they seem to be aligned differently and the Groupbox has a lot more space. Is there some option checked or is this the standard behavior? Any hints are highly appreciated! Thanks!

Here is what it looks like, as you can see there is no way except trial and error to arrange the checkboxes. On runtime there is easily enough space to have four colums in one row, in designer i can hardly fit three without having them overlap.

Left - Designer, Right - Runtime

like image 732
user871784 Avatar asked Nov 27 '25 00:11

user871784


1 Answers

To prevent the groupbox to resize according to its content, you should make GroupBox.AutoSize to false.

 GroupBox groupBox = new GroupBox();
 groupBox.AutoSize= false;
like image 125
Akash KC Avatar answered Nov 28 '25 16:11

Akash KC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!