Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6214999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:58:33+00:00 2026-05-24T06:58:33+00:00

The VCL form designer offers pink guidelines for aligning controls at their respective text

  • 0

The VCL form designer offers pink guidelines for aligning controls at their respective text base lines:
Guidelines in form designer
But as far as I can tell this doesn’t work for labels and checkboxes. Update: It works for labels if you place the controls exactly, e.g. by Ctrl–arrow. It kind of works for checkboxes – see screenshot.

Now, on some forms I’m creating controls in code, e.g.

ed := TEdit.Create(Self);
ed.SetBounds(...);
ed.Parent := SomePanel;

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 :-)):
base line aligned

Edit: My current approach is to call something like AlignTop(8, [Edit1, ComboBox1], [CheckBox1, Label1]); with

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;

My goal is to replace it with something more robust and less hacky.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:58:35+00:00Added an answer on May 24, 2026 at 6:58 am

    The guidelines are implemented in designtime code which license prohibits you to ship with your app so you can only use it to learn from it and then reimplement it yourself. Look up

    DesignIntf.TBaseComponentGuidelines
    DesignEditors.TComponentGuidelines
    VCLEditors.TControlGuidelines
    

    classes (in “{RADStudio\version}\source\ToolsAPI directory”). Perhaps it comes down to something simple as

    Label1.Top := (Edit1.Top + Edit1.Height) - Label1.Height + GetMagicConstant;  
    

    where GetMagicConstant is similar to TControlGuidelines.GetTextBaseline().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Delphi form with a bunch of VCL controls, like TButton and
I am using docking (VCL) in Delphi 7. In my main form, two other
I am working in the Borland C++Builder IDE, using VCL controls. I am trying
I'm using the following code to make a form transparent, but when the application
Varnish scripting seems rather robust for the vcl but I can't yet figure out
Trying to write a simple VCL program for educating purposes (dynamicly created forms, controls
I am using C++ Builder to create a VCL form application. Right now I
I'm using the Application.MessageBox to show messages on my VCL application, but when the
I'm using Delphi7 (non-unicode VCL), I need to store lots of WideStrings inside a
I have a Delphi 2007 VCL TPanel with a TPopupMenu assigned to it. There

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.