hwo取消c#.net中表单的resize事件 [英] hwo to cancel resize event of a form in c#.net
问题描述
大家好,
我正在使用c#.net开发一个Windows应用程序,因为我的形式之一
resize是真的,我想停止调整大小时表单大小达到有限的大小,由代码给出,是任何方式,所以请帮助我。我试过的代码如下:
感谢你
private void frmWebcam_Resize(object sender,EventArgs e)
{
if(this.Height == 278 || this.Width == 367)
..
}
Hi everybody,
I am developing a windows application using c#.net, in that i one of form
resize is true and i want to stop the resizing when the form size reaches limited size taht i given by code, is der any way to do, so pls help me. The code that i tried is given below.
Thanking you
private void frmWebcam_Resize(object sender, EventArgs e)
{
if (this.Height == 278 || this.Width == 367)
..
}
推荐答案
无论如何
der只是一个德语单词。
您可以设置表单的最大和最小大小,然后不会调整大小。
der is a word only in the German language.
You can set the max and minimum size of a form, then it won't resize beyond that.
你应该考虑尺寸变化的下限,例如:
You should consider a lower limit for the size changet, for example :
private void FrmParamManag_Resize(object sender, EventArgs e)
{
Control c = (Control)sender;
if (c.Size.Height < 466 || c.Size.Width < 502)
{
this.Size = new System.Drawing.Size(502, 466);
}
}
这篇关于hwo取消c#.net中表单的resize事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!