c# - 启用调整 Windows Forms 窗体的大小

标签 c# winforms resize

如何通过单击边框来调整表单大小?我什至将 FormBorderStyle 设置为 sizable。我错过了什么?

表单的属性如下:

Properties1

Enter image description here

Designer.cs 表单部分:

        //
        // Form1
        //
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
        this.ClientSize = new System.Drawing.Size(750, 378);
        this.Controls.Add(this.rtxt_inactiveprograms);
        this.Controls.Add(this.lbl_time);
        this.Controls.Add(this.lsv_runningapps);
        this.Controls.Add(this.btn_start);
        this.Controls.Add(this.label3);
        this.Controls.Add(this.textBox2);
        this.Controls.Add(this.lst_runningprocess);
        this.Controls.Add(this.label2);
        this.Controls.Add(this.label1);
        this.Controls.Add(this.txt_pcname);
        this.Controls.Add(this.btn_ping);
        this.Name = "Form1";
        this.Text = "Form1";
        this.Load += new System.EventHandler(this.Form1_Load);
        this.ResumeLayout(false);
        this.PerformLayout();

最佳答案

此处的调整大小问题是您只需将 AutoSizeModeGrowAndShrink 更改为 GrowOnly

但在这里调整大小不会影响表单的内容,也不会为您调整分辨率。

关于c# - 启用调整 Windows Forms 窗体的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25130120/

相关文章:

c# - C#Errorprovider.ContainerControl.Controls仅包含TabControl

c# - 在打开表单之前使用 Invoke 时出现 InvalidOperationException

java - 调整 JFrame 大小时会发生什么?

c# - 如何从 ViewModel 适本地在 View 中运行触发器?

c# - 从 ObservableCollection 中删除项目时 WPFToolkit Accordion ArgumentOutOfRangeException

c# - 在 C# 中转换和使用 "as"有什么区别?

c# - 使用 WinForm 或应用程序在客户端上打印

java - 如何在缩放图像后禁用调整图像大小?

php - 如何使用 PHP 从 mySQL 数据库获取图像并调整其尺寸?

c# - 如何在 Bot Framework 中禁用本地化程序