这有点令人沮丧我一直在处理一个应用程序,突然间我无法通过将鼠标移动到窗体的边缘来调整它的大小。我可以使用标准按钮最大化并最小化。
我正在使用FormBorderStyle = Sizable;
我检查了每一处房产,似乎无法弄清楚我必须意外改变的房产。我也可以使用Win + Left和Right来调整表单大小。对于我的生活,我无法弄清楚是什么导致了这一点。
以下是代码
namespace WindowsFormsApplication1
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// Form1
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(778, 545);
this.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
}
}
答案 0 :(得分:7)
正如我在评论中所说,这是问题所在:
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
AutoSize
应该是假的,并且不需要AutoSizeMode
您可以找到更多信息HERE
注意:请勿编辑
之类的问题“我找到了答案:......”
您应该将其设置回带代码的版本。