title: WinForms Anchor Control changes Location Origin?
body: <p>I have been porting my C# / .NET 2.0 project over to Mono for use on other platforms, but this seems to have brought up a problem in the NATIVE WinForms implementation.</p>
  
  <p>I have isolated the problem to the relationship between a Control's (specifically, a Button) Anchor property, and it's Location property's Y-component.  When the AnchorStyle property is set to Top, the origin of the Location property is the ClientArea of the form (excluding the Title Bar).  Changing the Anchor to Bottom, however changes the origin to the Top-Left corner of the entire Window (including the Title Bar).</p>
  
  <p>Here's a small Form class which illustrates the difference:</p>
  
  <pre><code>public class RawCodeForm : Form
  {
      public RawCodeForm()
      {
          Button b = new Button();
          b.Text = "Test";
          b.Location = new Point( 10, 10 );
          b.Size = new Size( 75, 23 );
          b.Anchor = AnchorStyles.Left | AnchorStyles.Top;
          //b.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
  
          this.Controls.Add( b );
          this.Size = new Size( 100, 200 );
          this.Location = new Point( 100, 100 );
          this.Show();
      }
  }
  </code></pre>
  
  <p>Try swapping the b.Anchor lines to see the change is position.</p>
  
  <p>Is this a documented bug, or am I missing another property that needs to be set?</p>
  
  <hr>
  
  <p>Edit:  Thanks for pointing out that the Form starts as Size(300,300).  I had assumed it was (0,0) until set.</p>
  
  <p>Outside of the simple test form above, the problem now looks to be that the FormBorderStyle being changed later is causing the form to resize.  My guess is that under Mono (or the host OS), the FormBorderStyle being changed resizes the ClientArea smaller, where-as the ClientSize area stays the same size in native WinForms.</p>