Visual studio 设计器 属性 window 对比设计器文件

Visual studio designer property window vs designer file

我的 visual studio GUI 设计器有问题。设计器显示了我的 .designer.cs 文件中的不同值。例如,item simpleButtonPrint,在设计器中我有以下属性:

// 
        // simpleButtonPrint
        // 
        this.simpleButtonPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
        this.simpleButtonPrint.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
        this.simpleButtonPrint.Appearance.Options.UseBackColor = true;
        this.simpleButtonPrint.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat;
        this.simpleButtonPrint.Image = ((System.Drawing.Image)(resources.GetObject("simpleButtonPrint.Image")));
        this.simpleButtonPrint.ImageLocation = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
        this.simpleButtonPrint.Location = new System.Drawing.Point(1146, 640);
        this.simpleButtonPrint.Margin = new System.Windows.Forms.Padding(15);
        this.simpleButtonPrint.Name = "simpleButtonPrint";
        this.simpleButtonPrint.Size = new System.Drawing.Size(98, 98);
        this.simpleButtonPrint.TabIndex = 9;
        this.simpleButtonPrint.Text = "simpleButton4";
        this.simpleButtonPrint.Click += SimpleButtonPrint_Click;

在我的 designer.cs 文件中,大小是 98, 98。在我 visual studio 的属性 window 中,大小是 131, 121。请看下面的截图:

同一按钮,在另一台机器上:

问题是当我在 GUI 设计器中进行任何更改时,它会修改我的 designer.cs 文件,就像它在 GUI 设计器中一样。这应该是我的 visual studio 的问题,因为当我的同事从 TFS 获得相同的版本时,他没有遇到同样的问题。有关如何解决此问题的任何建议?

解法:

我将缩放模式从 Font 更改为 DPI,现在一切正常。