title: Equivalent to designer guidelines in code
body: <p>The VCL form designer offers pink guidelines for aligning controls at their respective text base lines:
  <img src="https://i.stack.imgur.com/leWIk.png" alt="Guidelines in form designer"><br>
  <strike>But as far as I can tell this doesn't work for labels and checkboxes.</strike> <strong>Update:</strong> It works for labels if you place the controls <em>exactly</em>, e.g. by <kbd>Ctrl</kbd>-<kbd>arrow</kbd>. It kind of works for checkboxes - see screenshot.</p>
  
  <p>Now, on some forms I'm creating controls in code, e.g.</p>
  
  <pre><code>ed := TEdit.Create(Self);
  ed.SetBounds(...);
  ed.Parent := SomePanel;
  </code></pre>
  
  <p>etc. How can I ensure that their text base lines are aligned? I'd like to have this for edits, comboboxes, labels and checkboxes. The result should look like this (without the red line, of course :-)):
  <img src="https://i.stack.imgur.com/B7MFR.png" alt="base line aligned"></p>
  
  <p><strong>Edit:</strong> My current approach is to call something like <code>AlignTop(8, [Edit1, ComboBox1], [CheckBox1, Label1]);</code> with</p>
  
  <pre><code>procedure ControlArray_SetTop(const AControls: array of TControl; ATop: Integer);
  var
    i: Integer;
  begin
    for i := Low(AControls) to High(AControls) do
      AControls[i].Top := ATop;
  end;
  
  procedure AlignTop(ATop: Integer; const AControls: array of TControl; const ALabelLikeControls: array of TControl);
  begin
    ControlArray_SetTop(AControls, ATop);
    ControlArray_SetTop(ALabelLikeControls, ATop + 3);
  end;
  </code></pre>
  
  <p>My goal is to replace it with something more robust and less hacky.</p>