title: How to centre align the content of windows form application?
body: <p>I am developing a simple windows form application. But I am not able to center align the contents of the form. here are the images: <img src="https://i.stack.imgur.com/L4dDz.png" alt="enter image description here"></p>
  
  <p>Here's the code of the form:</p>
  
  <pre><code>namespace WindowsFormsApplication1
  {
  partial class Form1
  {
      /// &lt;summary&gt;
      /// Required designer variable.
      /// &lt;/summary&gt;
      private System.ComponentModel.IContainer components = null;
  
      /// &lt;summary&gt;
      /// Clean up any resources being used.
      /// &lt;/summary&gt;
      /// &lt;param name="disposing"&gt;true if managed resources should be disposed; otherwise, false.&lt;/param&gt;
      protected override void Dispose(bool disposing)
      {
          if (disposing &amp;&amp; (components != null))
          {
              components.Dispose();
          }
          base.Dispose(disposing);
      }
  
      #region Windows Form Designer generated code
  
      /// &lt;summary&gt;
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// &lt;/summary&gt;
      private void InitializeComponent()
      {
          System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
          this.textBox1 = new System.Windows.Forms.TextBox();
          this.button1 = new System.Windows.Forms.Button();
          this.pictureBox1 = new System.Windows.Forms.PictureBox();
          this.label1 = new System.Windows.Forms.Label();
          this.label2 = new System.Windows.Forms.Label();
          ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
          this.SuspendLayout();
          // 
          // textBox1
          // 
          this.textBox1.Location = new System.Drawing.Point(1, 1);
          this.textBox1.Name = "textBox1";
          this.textBox1.Size = new System.Drawing.Size(100, 20);
          this.textBox1.TabIndex = 0;
          // 
          // button1
          // 
          this.button1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("button1.BackgroundImage")));
          this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
          this.button1.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
          this.button1.FlatAppearance.BorderSize = 5;
          this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.HotTrack;
          this.button1.ForeColor = System.Drawing.Color.Coral;
          this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image")));
          this.button1.Location = new System.Drawing.Point(330, 275);
          this.button1.Name = "button1";
          this.button1.Size = new System.Drawing.Size(97, 123);
          this.button1.TabIndex = 1;
          this.button1.UseMnemonic = false;
          this.button1.UseVisualStyleBackColor = true;
          this.button1.Click += new System.EventHandler(this.button1_Click);
          // 
          // pictureBox1
          // 
          this.pictureBox1.Enabled = false;
          this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
          this.pictureBox1.ImageLocation = "";
          this.pictureBox1.Location = new System.Drawing.Point(270, 27);
          this.pictureBox1.Name = "pictureBox1";
          this.pictureBox1.Size = new System.Drawing.Size(221, 176);
          this.pictureBox1.TabIndex = 2;
          this.pictureBox1.TabStop = false;
          this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
          // 
          // label1
          // 
          this.label1.AutoSize = true;
          this.label1.Font = new System.Drawing.Font("OCR A Extended", 14.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
          this.label1.Location = new System.Drawing.Point(251, 226);
          this.label1.Name = "label1";
          this.label1.Size = new System.Drawing.Size(251, 20);
          this.label1.TabIndex = 3;
          this.label1.Text = "Please Touch Your Card";
          this.label1.Click += new System.EventHandler(this.label1_Click);
          // 
          // label2
          // 
          this.label2.AutoSize = true;
          this.label2.ForeColor = System.Drawing.Color.Red;
          this.label2.Location = new System.Drawing.Point(359, 433);
          this.label2.Name = "label2";
          this.label2.Size = new System.Drawing.Size(35, 13);
          this.label2.TabIndex = 4;
          this.label2.Text = "label2";
          // 
          // Form1
          // 
          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
          this.BackColor = System.Drawing.SystemColors.Highlight;
          this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
          this.ClientSize = new System.Drawing.Size(752, 502);
          this.Controls.Add(this.label1);
          this.Controls.Add(this.button1);
          this.Controls.Add(this.textBox1);
          this.Controls.Add(this.label2);
          this.Controls.Add(this.pictureBox1);
          this.Name = "Form1";
          this.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultBounds;
          this.Text = "Form1";
          this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
          this.Load += new System.EventHandler(this.Form1_Load);
          ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
          this.ResumeLayout(false);
          this.PerformLayout();
  
      }
  
      #endregion
  
      private System.Windows.Forms.TextBox textBox1;
      private System.Windows.Forms.Button button1;
  
      private System.Windows.Forms.Label label1;
      private System.Windows.Forms.Label label2;
      private System.Windows.Forms.PictureBox pictureBox1;
  }
  
  }
  </code></pre>
  
  <p>I tried using this,</p>
  
  <pre><code>  this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  </code></pre>
  
  <p>But even that did not help. </p>