Hello Friends,

I have a doubt....

Can we set the windows form resolution according to pc screen resolution
and even the control should be adjusted....is it possible???

eg.

My screen resolution is 1366 X 768

and my form size is 1254, 709....but I want it so set according to the screen and it will be dynamic...

if I transfer my project to some other pc with lower or higher resolution it should be adjusted....

and suppose I have few controls on the form...will that also be adjusted???

please do let me know....

thanks in advance...

Recommended Answers

All 6 Replies

to adjust the form's resolution you just have to set it to maximized and topmost to true.

the controls inside the form will not be adjusted if the sizes are static.

to dynamically change the forms controls you have to dock the controls, for you to be able to still layout the controls the way you want the controls to go, you can use a panel and create grids from where the controls will be place.

Place this in the form's load event:

    Me.Width = Screen.PrimaryScreen.Bounds.Width - 20
    Me.Height = Screen.PrimaryScreen.Bounds.Height - 20

Begginnerdev - This will be for the forms size...

can u tell me if controls will be placed accordingly....if the screen is maximized or minimized???

I guess only flowlayoutpanel will do this...

I got the answer....

For me the dock property is working perfectly fine....for my controls.....

I know this thread is solved, Pooja can you explain the solution in detail plz..

Actually My controls were not getting adjust if my form changes it size....and also I wanted my form to be according to the size of users screen

I set my form windows state to maximum so that it will be maximized for all users in their system

the controls will adjust as the form resizes .....the controls which are to the left will stay to the extreme left...

In my case...
In my form I used 4 panels...
panel1 - dock top
panel2 - dock left
panel3 - dock middle
panel4 - dock right

this when I will resize the form the panel stays at their positions...so we can include the controls in their panel and check...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.