title: Make dynamically created panels in winform responsive (same size as my flowlayoutPanel) - C#
body: <p>So I'm creating some panels with the following code</p>
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
  int xlocation = 5;
  
          for (int i = 0; i &lt; 10; i++)
          {
              Panel panel = new Panel();
              {
                  panel.Name = string.Format(&quot;{0}&quot;, i);
                  panel.Text = string.Format(i.ToString());
                  panel.BackColor = Color.White;
                  panel.Location = new System.Drawing.Point(xlocation, 30);
                  panel.Width = flowLayoutPanel1.Width;
                  panel.Height = 50;
                  panel.MouseEnter += new System.EventHandler(this.panel_MouseEnter);
                  flowLayoutPanel1.Controls.Add(panel);
  
  
  
                  Label label = new Label();
                  label.Location = new System.Drawing.Point(15, 10);
                  label.AutoSize = true;
                  label.Font = new System.Drawing.Font(&quot;Calibri&quot;, 13F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                  label.ForeColor = System.Drawing.Color.FromArgb(64, 64, 64);
                  label.Text = string.Format(&quot;{0}&quot;, &quot;GNU&quot; + i);
                  panel.Controls.Add(label);
  
                  Label label10 = new Label();
                  label10.Location = new System.Drawing.Point(15, 35);
                  label10.AutoSize = true;
                  label10.Font = new System.Drawing.Font(&quot;Calibri&quot;, 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                  label10.ForeColor = System.Drawing.Color.FromArgb(64, 64, 64);
                  label10.Text = string.Format(&quot;{0}&quot;, &quot;hest&quot;);
                  panel.Controls.Add(label10);
              }
              xlocation = xlocation + 85;
          }
     }
  </code></pre>
  <p>The problem is when I resize my form, my flowLayoutPanel obviously gets bigger, but the panels inside doesn't.</p>
  <p>I have tried using the</p>
  <pre><code>private void Form1_Resize(object sender, EventArgs e)
      {
          
      }
  </code></pre>
  <p>But it doesn't seem to work.</p>
  <p>Any answer is much appreciated!
  Thanks!</p>