标签页未在最小化/最大化时调整大小

时间:2017-08-20 21:21:37

标签: c# winforms

您好我的应用程序中有一个窗体,其中有一个标签控件。我注意到,当我在最小化它之后从任务栏恢复应用程序时,tabpage缩小到正常大小的一半,并且内部的所有控件都向下移动。我有停靠的tabpage填充TablePanelLayout。标签保留在原位。调整表单大小时不会发生这种情况。请帮忙。

这是来自designer.cs文件的相关代码

        // 
        // tabControl1
        // 
        this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
        this.tabControl1.Controls.Add(this.tabPage1);
        this.tabControl1.Controls.Add(this.tabPage2);
        this.tabControl1.Controls.Add(this.tabPage3);
        this.tabControl1.Controls.Add(this.lookupTab);
        this.tabControl1.Controls.Add(this.tabPage4);
        this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.tabControl1.ItemSize = new System.Drawing.Size(71, 35);
        this.tabControl1.Location = new System.Drawing.Point(3, 110);
        this.tabControl1.Multiline = true;
        this.tabControl1.Name = "tabControl1";
        this.tabControl1.SelectedIndex = 0;
        this.tabControl1.Size = new System.Drawing.Size(1453, 601);
        this.tabControl1.TabIndex = 0;
        this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
        // 
        // tabPage1
        // 
        this.tabPage1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.tabPage1.Controls.Add(this.panel2);
        this.tabPage1.Location = new System.Drawing.Point(4, 39);
        this.tabPage1.Name = "tabPage1";
        this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
        this.tabPage1.RightToLeft = System.Windows.Forms.RightToLeft.No;
        this.tabPage1.Size = new System.Drawing.Size(1445, 558);
        this.tabPage1.TabIndex = 0;
        this.tabPage1.Text = "Settings";
        this.tabPage1.UseVisualStyleBackColor = true;
        // 
        // tabPage2
        // 
        this.tabPage2.Controls.Add(this.label5);
        this.tabPage2.Controls.Add(this.label4);
        this.tabPage2.Controls.Add(this.label2);
        this.tabPage2.Location = new System.Drawing.Point(4, 39);
        this.tabPage2.Name = "tabPage2";
        this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
        this.tabPage2.Size = new System.Drawing.Size(1445, 558);
        this.tabPage2.TabIndex = 1;
        this.tabPage2.Text = "Calibration";
        this.tabPage2.UseVisualStyleBackColor = true;

1 个答案:

答案 0 :(得分:0)

我发现了什么问题。将其发布在此处以防其他人遇到同样的问题。 我将this.tabControl1.Multiline = true;设置为false,问题就消失了。