这有点令我感到沮丧,我一直在研究一个应用程序,突然间我无法通过将鼠标移动到窗体的边缘来调整它的大小.我可以通过标准按钮最大化和最小化.
我在用 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
    }
}
正如我在评论中所说,这是问题所在:
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
AutoSize应该是假的,没有必要AutoSizeMode
你可以在这里找到更多信息
注意:不要编辑类似的问题
"我找到了答案:......"
您应该将其设置回带有代码的版本.
| 归档时间: | 
 | 
| 查看次数: | 5317 次 | 
| 最近记录: |