title: Cannot modify expression because it is not a variable
body: <p>I'm trying to get an UserControl (which has a grid on it) on a Windows Form to resize.
  The below code is what I have in the Form.  The behavior I'm getting is that the control is resized when I make it big.  But it does not shrink.  What am I doing wrong (or) What am I missing?</p>
  
  <pre><code>private void AdjustGrid()
  {
      ZoomControl.Location = new Point(5, 5);
      ZoomControl.Size = new Size(this.Width - 15, this.Height - 75);
  }
  
  void zoomform_Resize(object sender, EventArgs e)
  {
      AdjustGrid();
  }
  </code></pre>
  
  <p>Now the user control has the following code:</p>
  
  <pre><code>//Resize the grid that the UserControl has on it
  private void NameValuePropertyBag_Resize(object sender, EventArgs e)
  {
      grdNameValueProperties.Location = new Point(4,4);
      grdNameValueProperties.Size = new Size(this.Width - 8, this.Height - 8);
  }
  </code></pre>
  
  <p><strike>
  I tried </p>
  
  <pre><code>grdNameValueProperties.Size.Width = this.Width - 8;
  grdNameValueProperties.Size.Height = this.Height -8;
  </code></pre>
  
  <p>It gives me "Cannot modify expression because it is not a variable" error...  What am I missing?
  </strike></p>
  
  <p>Additional Info:</p>
  
  <p>I'm using SetParent() Windows call to move/zoom an UserControl to another Form (ZoomForm). 
  <strike>
  Anchor doesn't seem to work for controls moved with SetParent()... More precisely, it may be working but I have repainting problems.
  </strike></p>
  
  <p>I got Anchor/Dock pair to working without repaint issues [I removed the resize event wireup and adjusted Dock to Fill]</p>
  
  <p>The ZoomForm initally has no controls.  The Usercontrol is added to the ParentForm dynamically.</p>
  
  <p>Currently, I'm able to make the zoom form bigger <strike>with the above code</strike> but not smaller.  </p>