Click here to Skip to main content
15,913,282 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I had written a program that is working well and showing well as designed on my computer. After deployment, the program is not showing well(not fitting the screen size) on another that system that the computer screen is smaller.I just need the code that will make my program fits all computer screens after installing it on them.It is a window based program written in vb.net
Thanks

What I have tried:

Nothing because i don't know how to go about it.
Posted
Updated 16-Dec-18 7:40am

There is no such code. The only way to work well with different screen sizes is to design your software from the start so that the screen size can be varied - in much the same way that Visual Studio does by having a central work area and allowing the user to "dock" all the other components around the outside or "float" them where they want.

You can't just take a piece of software and magically "make it fit" as windows defaults things like fonts, which affects the height of text boxes, buttons, and so forth.
 
Share this answer
 
Or you could use scaling option. You would have to simply call
VB
Form1.Scale = 0.9
(which means 90% of its original height / width). In addition, you would also need to remember to use TableLayoutPanels which are excellent container allowing you to arrange your controls when the form is stretched horizontally or vertically.

Usually the way I do it is by designing the form at 1024x768. Using table layout panels, I can tell the form controls to either Anchor (left / top / bottom / right) or stretch.

Again - no single implementation would work for all scenarios but this should work in most cases.
 
Share this answer
 
''on main screen load event write this code to change screen


If My.Computer.Screen.WorkingArea.Height < 700 And My.Computer.Screen.WorkingArea.Width < 1024 Then
changeRes(1366, 768)
Else
Me.WindowState = FormWindowState.Maximized
End If
 
Share this answer
 
v2

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