Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Resize window form in c#.net. when using desktop size is feet good but when using in laptop size is large out to screen using scroll and mini laptop is out to screen working is very difficult or not. how is remove this problem.....
Posted

If you are using windows forms, I would suggest you to use Anchor and Dock properties of windows form controls.
Here is an example - Working with Anchor and Dock properties[^].
 
Share this answer
 
v2
Compared to WPF, Windows Forms is very limited in its abilities to re-size dynamically on different screen-sizes; using the typical Controls provided by Win Forms, you may be surprised at how their internal elements ... which you can't modify ... don't "scale" well.

As Sri Abhnav points out, you can use the Dock and Anchor properties of Forms/Controls to try and get reasonably consistent positioning of your UI elements on different size, and different resolution, screens. You can also use the 'Margin and 'Padding properties of Controls to help create consistent positioning.

You can also use the 'Screen object in Windows Forms to get the actual screen-size of both the total area of the Form, or its 'DisplayRectangle (content area exclusive of Form Header, border).

Based on reading the screen-size at run-time, you could do some scaling of your UI elements as needed. Note that (in my experience) attempts to scale every UI elements usually end up as a disaster.

I encourage you to construct your basic layout using Panels, and/or (if appropriate) SplitContainer, TableLayoutPanel, etc.

Set the auto-scroll properties of the Panels as necessary.
 
Share this answer
 
v2
Dear khan_parvez
I would strongly recommend to read through: https://msdn.microsoft.com/en-us/library/windows/apps/dn958435.aspx[^]

I hope it will give you some ideas.
 
Share this answer
 
Start you application as maximized instead of having a fixed sized window.
To do that set following property-
C#
System.Windows.Forms.Form.WindowState=FormWindowState.Maximized;


Check this-
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.windowstate%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396[^]

Hope, it helps :)
 
Share this answer
 
Comments
BillWoodruff 7-Nov-15 9:31am    
This is not any kind of answer to the OP's concern.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900