0
votes

For example i just created a new Form i show him with a click button.

In the new form Designer i add 4 panels and docked them to the right left up down center.

Then added on the bottom panel a button for the test.

Now i did that on my screen resolution 1920X1080.

But when i switched the resolution to 1024X768 the button seems to be ok but the form it self went out of bounds to the left and right.

So how can i make that form will fit to the screen resolution changes ? I want the form to be full screen or not full screen but to fit the new resolution each time i change my monitor resolution.

Not only the controls to fit but also the form if the form size was 170X120 so i dont want to change the form size but to fit him to the new resolution. I mean maybe i will have to change the size of the form but the idea is to keep the form how it was and fit him to the new resolution.

2

2 Answers

0
votes

One of the easiest ways to do it is to use percentages as opposed to pixel values. Set the width of the form to 100% and each of the elements within them to 25% or whatever you need to fill the space. That's my initial stab at it without seeing any code.

0
votes

You can use the anchor property to have controls adjust to the size of the window.

Here is a great article on how to use the anchor:

http://www.techrepublic.com/article/manage-winform-controls-using-the-anchor-and-dock-properties/6165908