title: How would one go about resizing controls in relation to the window that contains them?
body: <p>How would one go about resizing controls in relation to the window that contains them? I'd like to do this in order to to have the control take up a particular amount of the screen, regardless of whether the window is maximised, and independent of monitor resolution. </p>
  
  <p>I have tried setting control.Width as equal to a multiple of Me.ParentForm.Width and done the same for height. I'm unsure of how to properly access the properties of the form/window in order to resize controls in relation to it. I also tried to alter the .Left property in the same way to set the relative position of the control.</p>
  
  <pre><code>    Display.Width = Me.ParentForm.Width * 0.25
      Display.Top = 0
      Display.Left = Me.ParentForm.Width - Me.Width
  </code></pre>
  
  <p>The code was intended to make the control take up the entire top-right quadrant of the window, whether it was maximised or not. However, I instead got an exception saying that Me.ParentForm.Width had no value.</p>
  
  <p>This is the exception message:</p>
  
  <blockquote>
    <p>"System.NullReferenceException: 'Object reference not set to an
    instance of an object.'</p>
    
    <p>System.Windows.Forms.ContainerControl.ParentForm.get returned
    Nothing."</p>
  </blockquote>