Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
We have developed POS system using windows application ,but there is a requirement to make it responsive ,which is not possible.

we have another option to convert it into WPF but it will require more time.

What I have tried:

any one have suggestion to make windows form application which adjust according to screen resolution.
Posted
Updated 24-Apr-18 20:52pm

Pretty much, you can't make a WinForms app respond well to different resolutions: it's possible, but it's a heavy amount of work and probably won't be too wonderful when you are finished.
The problem is that although all controls can be Anchored and Docked so they resize automatically, that doesn't have any effect on text within the controls: so you end up with a large button with tiny unreadable text in the middle, or a tiny button with huge unreadable text in the middle.

While it's possible to get round this by handling the Resize event for each control and working out what font size to use based on the new display area, that's not trivial and generally takes a fair amount of trial and error, plus the odd "fudge factor" thrown in to deal with strange cases.

You can do it, but it's serious work - WPF handles it a lot better!

The other solution is to redesign your UI to work well at multiple resolutions in the same way tat Visual Studio does: a central "work space" with all the tools in panels which float or dock round the edges. But for a POS system, that probably isn't practical!
 
Share this answer
 
You can evaluate TableLayoutPanel and ensure that columns and rows are defined as a percentage instead of absolute values. You would also need to work out docking and anchoring for individual controls.

If you are looking for layout to switch from, say, horizontal to vertical, then you will need to work with resizing event of the form.
 
Share this answer
 
Comments
Kinjal Sucess 7-May-18 8:40am    
thanks for the reply, but it does not work for dynamically created controls like Panel, label, button, images. it does not make 100% responsive form.

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