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 252137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:39:11+00:00 2026-05-11T21:39:11+00:00

I have noticed that in Delphi 2009, the text in a multi-line memo has

  • 0

I have noticed that in Delphi 2009, the text in a multi-line memo has different padding on the left from that in a single-line edit, though both are based on TCustomEdit. The exact offset depends on the font size:

alt text http://img188.imageshack.us/img188/7668/editmemo.png

I am looking for a simple way to get the memo text aligned with the same offset as edit text. If that is not possible, how about a method of calculating what the offset is going to be in pixels, given the font size, so that I could adjust the positioning of the (dynamically created and positioned) fields before displaying them? I think that in an earlier release of Delphi, the two offsets were the same.

  • 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-11T21:39:11+00:00Added an answer on May 11, 2026 at 9:39 pm

    There is EM_GETMARGINS. I’m not sure if that counts as “simple”. 🙂

    EDIT: Try this:

    type
      tSynMargins = record
        left, right: Word;
      end;
    
    function GetLeftMargin(hEdit: HWND): Word;
    var
      margins: Longint;
    begin
      margins := SendMessage(hEdit, EM_GETMARGINS, 0, 0);
      Result := tsynMargins(Margins).left;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      Edit1.Text := IntToStr(GetLeftMargin(Edit1.Handle));
      Memo1.Text := IntToStr(GetLeftMargin(Memo1.Handle));
    end;
    

    (inspired by this)

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

Sidebar

Related Questions

I have noticed that with Delphi 2009, I often get strange errors when compiling,
I have noticed that cURL in PHP returns different data when told to output
I have noticed that my application's Document folder is sometimes different. The workflow was
I have noticed that some apps have a distinction between 'Invites from friends' vs
I have noticed that some mails come with the from address like : Adam
I have noticed that sketching a box and filling a box leads to different
I have noticed that for some reason my objects that are neither coming from
HI I have an application written in Delphi 2006. I have noticed that when
I noticed that when I install Delphi(6,7,2000,2010), I have the option to install powerpoint
I have noticed that when I type an operator in REPL, it is often

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.