Winforms :: Why changing Form Font resize some controls?
All my forms inherits from one base form where we handle background paint and set standard properties.
Recently, I think of cheching if the app is running on Vista or Later to use Segoe UI font, and I added this.
The problem is than inherited forms changed sizes and their inner controls changed also... even PictureBoxes!! The controls and forms seems to be thinner (in width), so square picturebox became vertical rectangules!
Sometime ago when I changed from the standard (?) Sans Serif to Verdana, the same happened but in 开发者_运维技巧that time my app were way smaller and I checked and fixed every form... now with hundreds of forms is not handy.
Any idea why this happend and what could be the way to workaround it?
Just change the AutoScaleMode property of the Form. By default it will be Font, so if you change the Font property it will resize the Form. You can get more information about it from AutoScaleMode Enumeration in MSDN :
精彩评论