C# Windows 10中的Winform Designer边框故障
我在表单中有一个C# Windows 10中的Winform Designer边框故障,c#,.net,winforms,windows-forms-designer,designer,C#,.net,Winforms,Windows Forms Designer,Designer,我在表单中有一个PictureBox,Dock属性PictureBox设置为Fill。 现在,为了只保留表单的边框,我将ControlBox属性设置为false,将FormBorderStyle设置为SizableToolWindow。 在Windows 7中,它如下所示 但在Windows10中,相同的代码如下所示 有人能解释为什么白色边框出现在顶部吗?我尝试了删除填充、边距和重建解决方案。这些都没用 在windows 10(Visual Studio 2015,Designer)中,窗体
PictureBox
,Dock属性PictureBox
设置为Fill。现在,为了只保留表单的边框,我将
ControlBox
属性设置为false,将FormBorderStyle
设置为SizableToolWindow
。
在Windows 7中,它如下所示但在Windows10中,相同的代码如下所示 有人能解释为什么白色边框出现在顶部吗?
我尝试了删除填充、边距和重建解决方案。这些都没用
在windows 10(Visual Studio 2015,Designer)中,窗体看起来很正常(没有白色上边框)
.Net目标框架版本:v4.6
附言:图片取自 更新:下面是Windows窗体设计器生成的代码
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Preview_Image));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(284, 261);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// Preview_Image
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.ControlBox = false;
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "Preview_Image";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
请查看下面的链接,可能会对您有所帮助谢谢您的回复Akhilesh,我查看了您共享的链接,但这与没有寄宿生有关。。我遇到的问题是额外的边界。我仍然调整了windows中的阴影设置,但没有帮助。是否有任何代码需要共享?@TaW,我已经用代码更新了问题,看一看。好的,没有什么特别的。我可以确认结果。看起来Clientsize在顶部被任何大小的borderstyle缩小了。。