title: Winform Dynamic Alignment
body: <p>I'm attempting to dynamically add a series of controls to a form, but the primary problem is that they are completely misaligned. I've tried updated the control information and fixed minor problems but they are still misaligned.</p>
  
  <p>I'm unsure what I'm missing on the alignment problem:</p>
  
  <pre><code>public void loadSkill(string skillName)
      {
          FlowLayoutPanel panel = new FlowLayoutPanel();
          standardSkillsLayoutPanel.Controls.Add(panel);
          panel.Dock = DockStyle.Top;
          panel.Height = 28;
          panel.Width = 450;
  
          Label skillLabel = new Label();
          panel.Controls.Add(skillLabel);
          skillLabel.MinimumSize = new Size(120, 20);
          skillLabel.MaximumSize = new Size(120, 20);
          skillLabel.Text = skillName;
          skillLabel.Location = new System.Drawing.Point(0, 0);
          skillLabel.Dock = DockStyle.Left;
  
          Label skillStats = new Label();
          panel.Controls.Add(skillStats);
          skillStats.Text = "DEX + STR";
          skillStats.MinimumSize = new Size(80, 20);
          skillStats.MaximumSize = new Size(80, 20);
          skillStats.Margin = new Padding(3, 0, 3, 0);
          skillStats.Dock = DockStyle.Left;
  
          Label skillBasePercent = new Label();
          panel.Controls.Add(skillBasePercent);
          skillBasePercent.MinimumSize = new Size(60, 20);
          skillBasePercent.MaximumSize = new Size(60, 20);
          skillBasePercent.Text = "10";
          skillBasePercent.Dock = DockStyle.Left;
          skillBasePercent.Location = new System.Drawing.Point(210, 0);
  
          NumericUpDown skillCulturalUpdown = new NumericUpDown();
          panel.Controls.Add(skillCulturalUpdown);
          skillCulturalUpdown.MinimumSize = new Size(40, 20);
          skillCulturalUpdown.MaximumSize = new Size(40, 20);
          skillCulturalUpdown.Margin = new Padding(3, 0, 3, 0);
          skillCulturalUpdown.Value = 0;
          skillCulturalUpdown.Dock = DockStyle.Left;
  
          NumericUpDown skillProfessionalUpdown = new NumericUpDown();
          panel.Controls.Add(skillProfessionalUpdown);
          skillProfessionalUpdown.MinimumSize = new Size(40, 20);
          skillProfessionalUpdown.MaximumSize = new Size(40, 20);
          skillProfessionalUpdown.Margin = new Padding(3, 0, 3, 0);
          skillProfessionalUpdown.Value = 0;
          skillProfessionalUpdown.Dock = DockStyle.Left;
  
          NumericUpDown bonusUpDown = new NumericUpDown();
          panel.Controls.Add(bonusUpDown);
          bonusUpDown.Value = 0;
          bonusUpDown.MinimumSize = new Size(40, 20);
          bonusUpDown.MaximumSize = new Size(40, 20);
          bonusUpDown.Margin = new Padding(3, 0, 3, 0);
          bonusUpDown.Dock = DockStyle.Left;
  
          Label skillTotalPercent = new Label();
          panel.Controls.Add(skillTotalPercent);
          skillTotalPercent.Text = "10";
          skillTotalPercent.MinimumSize = new Size(50, 20);
          skillTotalPercent.Dock = DockStyle.Left;
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wx4C6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wx4C6.png" alt="misaligned rows"></a></p>