简体   繁体   English

Visual Studio设计器属性窗口与设计器文件

[英]Visual studio designer property window vs designer file

I have a problem with my visual studio GUI designer. 我的Visual Studio GUI设计师遇到问题。 The designer shows different values from my .designer.cs file. 设计器显示了与.designer.cs文件不同的值。 For example, item simpleButtonPrint, in the designer I have the following properties: 例如,项目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;

In my designer.cs file, the size is 98, 98. In my properties window from visual studio the size is 131, 121. See the screenshot below: 在我的designer.cs文件中,大小为98、98。在Visual Studio的属性窗口中,大小为131、121。请参见以下屏幕截图:

Visual Studio属性窗口

Same button, on another machine: 在另一台计算机上使用相同的按钮: 在此处输入图片说明

The problem is when I make any change in the GUI designer, it modifies my designer.cs file as how it is in the GUI designer. 问题是,当我在GUI设计器中进行任何更改时,它都会像在GUI设计器中一样修改我的designer.cs文件。 It should be a problem with my visual studio, as when my coworker gets the same version from TFS, he does not have the same problem. 我的Visual Studio应该有问题,因为当我的同事从TFS获取相同版本时,他就不会遇到相同的问题。 Any suggestions on how to fix this issue? 有关如何解决此问题的任何建议?

Solution: 解:

I changed the scaling mode from Font to DPI, now everything works fine. 我将缩放模式从字体更改为DPI,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM