有点令人沮丧,我一直在开发一个应用程序,突然间我无法通过将鼠标移动到表单边缘来调整其大小了。使用标准按钮时,我可以最大化和最小化。
我正在使用 FormBorderStyle = Sizable;
我已经检查了每个属性,似乎找不到我必须意外更改的属性。我还可以使用 Win+左键和右键来调整窗体大小。但是,我怎么也想不出这是什么原因导致的。
下面是代码
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
}
}
AutoSize
属性为真,您将无法手动调整窗体大小。请检查一下。 - user1300630AutoSizeMode
设置为GrowAndShrink
。根据MSDN的使用说明:"该控件不能手动调整大小。" 默认情况下,您只能使表单变大。 - user1300630