[英]Enable resizing Windows Forms forms
How can I resize my forms by clicking their border? 如何单击表单边框来调整其大小? I even set FormBorderStyle
to sizable
. 我什至将FormBorderStyle
设置为sizable
。 What am I missing? 我想念什么?
Here are the properties of the form: 以下是表单的属性:
Designer.cs Form part: 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();
The resizing issues here are that you just need to change AutoSizeMode
from GrowAndShrink
to GrowOnly
. 这里的调整问题是,你只需要改变AutoSizeMode
从GrowAndShrink
到GrowOnly
。
But resizing here doesn't affect the contents of the form and doesn't adjust to you the resolution. 但是,此处调整大小不会影响表单的内容,也不会根据您的分辨率进行调整。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.