我一直在开发应用程序,这真令人沮丧,突然之间,我无法通过将鼠标移到窗体的边缘来调整其大小。我可以使用标准按钮来最大化和最小化罚款。

我正在使用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应该为false,并且不需要AutoSizeMode您可以找到更多信息HERE

注意:请勿编辑类似的问题



您应该将其设置回带有代码的版本。

关于c# - 表格不可调整大小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17184788/

10-11 23:09
查看更多