title: Adjust form and control size to different screen resolutions, Visual Basic VB.NET
body: <p>I’ve created a bit of a problem for myself and im hopping someone here can help with it.</p>
  
  <p>I’ve created an app in Visual Basic on my desktop PC with a screen res of 1280x1024 and used images that I’ve created in illustrator as background images and buttons(the largest images is a backgroud image 1004x804) . It looks great on my desktop but when I run it on my laptop with a screen res of 1366x768 the form height is too large and the bottom portion of the form is cut off.</p>
  
  <p>So the way im thinking I might be able to fix it is by getting the screen res on form load and checking it against the form size then resizing the form. This is the code im using on form load to do this.</p>
  
  <pre><code>Dim intH As Integer = Screen.PrimaryScreen.Bounds.Height
  Dim intW As Integer = Screen.PrimaryScreen.Bounds.Width
  
      If Me.Height &gt; intH Then
          Me.Height = intH
          Me.Width = intW
      End If 
  </code></pre>
  
  <p>But the problem is that I want everything including all the controls (that are pictureBoxs with background images) to be adjusted to about 50% of the screen size if the form is larger than the height or width…. I can’t work out how to do this, if it’s possible or if it’s the best way to go about solving this problem. Can someone nudge me in the right direction please?</p>