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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Mar 1, 2011, 12:56 AM EST
If that's the case, then I'd try:
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Feb 24, 2011, 2:39 AM EST
You can try to change the width and height instead changing the size as like this.
this.Width =XXXY;
this.Height = YYYY;
Suthish NairRank #92 · 22.8K reputationPosted Feb 24, 2011, 2:48 AM EST
This a WinForm or Web Apps.?
What you trying to do?
Suthish NairRank #92 · 22.8K reputationPosted Feb 27, 2011, 7:20 AM EST
Amruta Kirdat72 reputationPosted Mar 1, 2011, 12:29 AM EST
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
Amruta Kirdat72 reputationPosted Mar 1, 2011, 12:31 AM EST
FroglegRank #1,020 · 1.9K reputationPosted Mar 1, 2011, 12:57 AM EST
this.MaximumSize =new System.Drawing.Size(840,440);
this.Size = new System.Drawing.Size(840, 440);
Amruta Kirdat72 reputationPosted Mar 1, 2011, 1:27 AM EST
Thx Vulpes this is working....