Reputation: 1294
I am having a problem with my Visual Studio. Form always change its size at runtime.
The form's size when designed is 1732; 1005 as shown in the figure below:
But when I run the program, the form's size changes to a smaller size (new size: 868;491) as shown below:
I already tried changing the DPI and the resolution of the PC that I am using but it's still the same. What will I change to get the actual size of the designed UI at runtime?
Upvotes: 0
Views: 2891
Reputation: 11
Try setting "AutoScaleMode" on the form to "None". I found my form was set to mode "Font". After I changed the font size on a few GUI components, the form's layout was far different at run time from what I saw in the designer. After setting the scale mode to "None", the form looked great at run time.
Upvotes: 1
Reputation:
Could it be, that the forms AutoSize = true
and AutoSizeMode = GrowAndShrink
?
Then change AutoSize to false or set AutoSizeMode to GrowOnly
Upvotes: 0
Reputation: 3141
Try setting FormBorderStyle to FixedDialog or something related to Fixed****. Also you can try setting MinimumSize and MaximumSize to 1732; 1005.
Upvotes: 0