Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
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)
..
}
Posted

vpmanu wrote:
is der any way


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.
 
Share this answer
 
Comments
George_Botros 21-Jul-10 8:44am    
Reason for my vote of 5
that is a good way to to stop resizing under a certain size and simple
You should consider a lower limit for the size changet, for example :
C#
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);
            }
        }
 
Share this answer
 
v2
Comments
[no name] 19-Aug-13 8:26am    
Why are you answering a question that was asked and answered 3 years ago?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900