Click here to Skip to main content
13,456,194 members
Rate this:
Please Sign up or sign in to vote.
I am doing a project with VB.Net.

My Form (Frm_Main) is currently running in 1600*1900 resolution.

When i run in another computer which have 1366*768 resolution, My (Frm_Main) is larger than screen size and some of the form's components is displaying outside of the screen.

How can i do my (Frm_Main) size to compatable with all screen's resolution?
Posted 15-Oct-12 0:15am
Updated 15-Oct-12 0:16am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can't, in most cases.
You can in WPF, because it is designed differently, and has zooming an scales built in - but Winformas apps do not, and generally do not scale well. There are ways to move and resize controls automatically, but it it does not affect text at all, and that can make things look for strange, or unreadable.

If you need to design a winforms at 1600x1900 to fit all your controls in the first place, then I suspect you need to look at your UI in some detail, and reduce the controls count - if only to make it more usable for the user. Grouping controls on tab pages may be a way to go.
heinhtataung 15-Oct-12 6:48am
Do u mean to do a new project with WPF instead of my current project ?
OriginalGriff 15-Oct-12 7:29am
Basically, yes - or redesign your whole UI to fit on a more "normal" screen size
heinhtataung 15-Oct-12 23:36pm
Thanks sir ! :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

By adding items to TableLayout Panel and writing this code to form_Load

If SystemInformation.WorkingArea.Height > 1200 Then
          Me.Scale(New SizeF(1.3F, 1.3F))
      End If

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04-2016 | 2.8.180322.1 | Last Updated 2 Nov 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100