Hi,
I am creating winform application.
I set all controls in a panel of form.
when I set different screen resolutions the form layout is changed.
please can you tel me how to set fixed size based on screen resolutins
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
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 13, 2011, 7:58 AM EDT
Try this on load:
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
Please do not forget to mark "Accepted Answer".
raja ramesh46 reputationPosted Oct 13, 2011, 8:14 AM EDT
after writting the following code also I unable to get correct layout of form I am sending screenshot for this
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
Thakn you,
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 13, 2011, 8:30 AM EDT
http://www.techrepublic.com/article/manage-winform-controls-using-the-anchor-and-dock-properties/6165908
Please do not forget to mark "Accepted Answer".
raja ramesh46 reputationPosted Oct 13, 2011, 8:49 AM EDT
Can you set form size based on screen resolutions without using Dock and Anchor properties ?
Please tel me how to do ?
Thank you
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 13, 2011, 9:01 AM EDT
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
raja ramesh46 reputationPosted Oct 14, 2011, 12:29 AM EDT
No, I did not get form resize based on the screen resolution using the command you have given.
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
I sent screenshot to you.
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 14, 2011, 11:25 AM EDT
Prabhu RajaRank #861 · 2.6K reputationPosted Oct 14, 2011, 9:06 PM EDT
try this one. Click Here
raja ramesh46 reputationPosted Oct 15, 2011, 5:28 AM EDT
int intX = Screen.PrimaryScreen.Bounds.Width;
int intY = Screen.PrimaryScreen.Bounds.Height;
if (intX < this.Width)
this.Width = intX;
if (intY < this.Height)
this.Height = intY;