Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Winforms窗口在运行时的大小不同_C#_Winforms - Fatal编程技术网

C# Winforms窗口在运行时的大小不同

C# Winforms窗口在运行时的大小不同,c#,winforms,C#,Winforms,目前我正在开发一个小型winforms应用程序。但我对尺寸有问题。我在设计器中设置了一个大小,如果大小正确并且正确,我还检查了初始化组件。但是当我运行程序时,它的大小比设计器中的小。以下是一些截图: 在设计器中: 在运行时: 初始化组件方法时的我的代码: this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoSca

目前我正在开发一个小型winforms应用程序。但我对尺寸有问题。我在设计器中设置了一个大小,如果大小正确并且正确,我还检查了初始化组件。但是当我运行程序时,它的大小比设计器中的小。以下是一些截图:

在设计器中:

在运行时:

初始化组件方法时的我的代码:

    this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(800, 1092);
    this.Controls.Add(this.addressTextBox);
    this.Controls.Add(this.addressLabel);
    this.Controls.Add(this.descriptionRichTextBox);
    this.Controls.Add(this.homepageTextBox);
    this.Controls.Add(this.endDateTextBox);
    this.Controls.Add(this.startDateTextBox);
    this.Controls.Add(this.locationTextBox);
    this.Controls.Add(this.homepageLabel);
    this.Controls.Add(this.endDateLabel);
    this.Controls.Add(this.startDateLabel);
    this.Controls.Add(this.locationLabel);
    this.Controls.Add(this.descriptionLabel);
    this.Controls.Add(this.nameTextBox);
    this.Controls.Add(this.nameLabel);
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
    this.MaximizeBox = false;
    this.Name = "EventDetailsWindow";
    this.Text = "ParkManager - Veranstaltung";
    this.ResumeLayout(false);
    this.PerformLayout();

this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font更改为
None
@ZoharPeled尝试过,但看起来很糟糕。有太多东西可以更改WinForms的大小,因此此框不够大,无法列出所有这些内容。每一件事情都有很好的理由,你最好让他们做他们的工作;不要试图让运行时输出看起来和您的开发机器上的完全一样,因为这几乎肯定会使其他人无法使用它