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.
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.
raja rameshPosted Oct 15, 2011, 9:28 AM
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;
Prabhu RajaPosted Oct 15, 2011, 1:06 AM
try this one. Click Here
Javeed M ShaikhPosted Oct 14, 2011, 3:25 PM
raja rameshPosted Oct 14, 2011, 4:29 AM
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 ShaikhPosted Oct 13, 2011, 1:01 PM
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
raja rameshPosted Oct 13, 2011, 12:49 PM
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 ShaikhPosted Oct 13, 2011, 12:30 PM
http://www.techrepublic.com/article/manage-winform-controls-using-the-anchor-and-dock-properties/6165908
Please do not forget to mark "Accepted Answer".
raja rameshPosted Oct 13, 2011, 12:14 PM
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 ShaikhPosted Oct 13, 2011, 11:58 AM
Try this on load:
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
Please do not forget to mark "Accepted Answer".