I am trying to change form size programmatically at load event of form using following code
this.size = new size(840,440);
but this is not working...
can anyone tell me solution???
Thx in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 1, 2011, 5:56 AM
If that's the case, then I'd try:
Amruta KirdatPosted Mar 1, 2011, 6:27 AM
Thx Vulpes this is working....
FroglegPosted Mar 1, 2011, 5:57 AM
this.MaximumSize =new System.Drawing.Size(840,440);
this.Size = new System.Drawing.Size(840, 440);
Amruta KirdatPosted Mar 1, 2011, 5:31 AM
Amruta KirdatPosted Mar 1, 2011, 5:29 AM
this.width = XXX;
this.height = YYY;
but this is also not working....Actually exact description of my problem is as :
I'm openings frmForm from menu streep. at design mode i have set this form's size as 840,440. but when i run the application and open frmForm from menu it gets maximized i.e its form size changes to 1277,780 but i wann to display form in 840,440 size. for this to happen i tried to set width and height of the form in load by using above code but this is also not working...can anyone help me....
thx
Suthish NairPosted Feb 27, 2011, 12:20 PM
Suthish NairPosted Feb 24, 2011, 7:48 AM
This a WinForm or Web Apps.?
What you trying to do?
Jaganathan BantheswaranPosted Feb 24, 2011, 7:39 AM
You can try to change the width and height instead changing the size as like this.
this.Width =XXXY;
this.Height = YYYY;