title: keep button position on panel resize
body: <p>I've been messing around with something that should be simple.</p>
  
  <p>I've moved jobs and trying to get some of the basic tools I have used before, but of course I don't have the old source to look at.</p>
  
  <p>We had extended panel to have some standard properties and functions (save, close, save and close).</p>
  
  <p>But I can't get the buttons to be positioned correctly on a resize.  I put this ExtPanel on a form but the buttons keep disappearing as I resize, or don't move as expected (frozen on bottom right).</p>
  
  <p>The class </p>
  
  <pre><code>public partial class ExtPanel: UserControl
     {
     private System.Windows.Forms.Button btnSaveandClose;
     private System.Windows.Forms.Button btnCancel;
     private System.Windows.Forms.Button btnSave;
  
     public ExtPanel ()
        {
        InitializeComponent ();
        }
  
  // misc things this class does...
  
  
  }
  
  public partial class ExtPanel
      {
      private void InitializeComponent ()
         {
          this.btnSaveandClose = new System.Windows.Forms.Button();
          this.btnCancel = new System.Windows.Forms.Button();
          this.btnSave = new System.Windows.Forms.Button();
          this.panel1 = new System.Windows.Forms.Panel();
          this.panel1.SuspendLayout();
          this.SuspendLayout();
          // 
          // btnSaveandClose
          // 
          this.btnSaveandClose.Location = new System.Drawing.Point(899, 689);
          this.btnSaveandClose.Name = "btnSaveandClose";
          this.btnSaveandClose.Size = new System.Drawing.Size(100, 30);
          this.btnSaveandClose.TabIndex = 0;
          this.btnSaveandClose.Text = "Save and Close";
          this.btnSaveandClose.UseVisualStyleBackColor = true;
          this.btnSaveandClose.Click += new System.EventHandler(this.Click_SaveandClose);
          this.btnSaveandClose.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  
          // 
          // btnCancel
          // 
          this.btnCancel.Location = new System.Drawing.Point(687, 689);
          this.btnCancel.Name = "btnCancel";
          this.btnCancel.Size = new System.Drawing.Size(100, 30);
          this.btnCancel.TabIndex = 1;
          this.btnCancel.Text = "Cancel";
          this.btnCancel.UseVisualStyleBackColor = true;
          this.btnCancel.Click += new System.EventHandler(this.Click_Close);
          this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  
          // 
          // btnSave
          // 
          this.btnSave.Location = new System.Drawing.Point(793, 689);
          this.btnSave.Name = "btnSave";
          this.btnSave.Size = new System.Drawing.Size(100, 30);
          this.btnSave.TabIndex = 2;
          this.btnSave.Text = "Save";
          this.btnSave.UseVisualStyleBackColor = true;
          this.btnSave.Click += new System.EventHandler(this.Click_Save);
          this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  
          // 
          // panel1
          // 
          this.panel1.AutoScroll = true;
          this.panel1.Controls.Add(this.btnSave);
          this.panel1.Controls.Add(this.btnCancel);
          this.panel1.Controls.Add(this.btnSaveandClose);
          this.panel1.Location = new System.Drawing.Point(0, 0);
          this.panel1.Name = "panel1";
          this.panel1.Size = new System.Drawing.Size(1008, 730);
          this.panel1.TabIndex = 0;
          // 
          // ExtPanel
          // 
          this.Controls.Add(this.panel1);
          this.Name = "ExtPanel";
          this.Size = this.panel1.Size;
          this.Click += new System.EventHandler(this.click_this);
          this.panel1.ResumeLayout(false);
          this.ResumeLayout(false);
  
          }
  
      #endregion
  
      private System.Windows.Forms.Panel panel1;
  
  
  }
  </code></pre>