2017-02-13 110 views
0

我的视觉工作室GUI设计人员遇到问题。设计者从我的.designer.cs文件中显示不同的值。例如,项目simpleButtonPrint,在设计师,我有以下特性:视觉工作室设计师属性窗口vs设计器文件

// 
     // 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的大小是131,121我的属性窗口。见下图:

Visual studio properties window

相同的按钮,另一台机器上: enter image description here

问题是,当我在做的GUI设计的任何变化,它改变我designer.cs文件是如何在GUI设计器中进行的。这应该是我的视觉工作室的问题,因为当我的同事从TFS获得相同的版本时,他没有同样的问题。有关如何解决此问题的任何建议?

+0

当您从设计器视图更改控件的属性时,将更改designer.cs文件。在designer.cs文件中的代码被执行并且控件被初始化并且在转换时按照写在那里的代码放置在窗体上。要与同事确认,可以让他/她在设计师视图中更改某些内容,并保存表单并与designer.cs一起保存。它应该要求检出文件或自动检出文件并对designer.cs文件进行更改。 –

+0

我编辑过我的帖子,来自同一个用户控件属性窗口的屏幕截图,但是在不同的机器上。在另一台机器上显示正确的尺寸(98,98)。一切工作正常,直到我在我的机器上修改它。 – user1408786

+2

这两台电脑有不同的图形DPI设置。但还有其他属性也有所不同:位置,边距等。 – LarsTech

回答

-1

解决方案:

我改变后的缩放模式,从字体到DPI,现在一切工作正常。