'Why winform control size can't change according to my input value
i am buling a project with vs2022 winform on .net-framework4.8. when i add a label(any control) control to windows form,i can cange control side by mouse as i like,it working fine.but if i change side by change size directly,then the return size didn't change according to my input value. for example, my original size is 267x36 if i want to change height to 30, the return value become 223x25, and the size and location on windows form also abnormal,looks like both change automatic. even i try to select two control, and use vs2022 button "make them same side",the second control also return a wrong size.enter image description here i am using a laptop with 150% scaling and screen resolution 2560x1600
picture1,original size picture2,return size2 picture3,windows form 3
Solution 1:[1]
It's because AutoSize is set to true by default for labels. Disabling AutoSize will let you control the size manually.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | NoobyGamr |
