winform控件显示异常

使用了和他人一样的代码,但是自己的软件窗体界面显示异常(控件异常靠左,没有居中),别人的软件显示正确。
例如:
FrmSysSet.designer.cs
窗体设计文件的Drawing.SizeF函数异常。手动修改代码

更新前:

点击查看代码
            // FrmSysSet
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1264, 650);

更新后:

代码如下:

点击查看代码
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1264, 650);

差别
System.Drawing.SizeF(7F, 14F);
改为 7F而不是先前的6F

posted @ 2023-03-15 01:50  聆听微风  阅读(164)  评论(0编辑  收藏  举报