In Delphi, is there a way to adjust the line spacing of TMemo?

I am working with the TMemo component to display some text in a limited space. Currently, it uses the truetype font, which does not come with windows and is installed by the application when it starts.

On my PC (running Windows XP), the distance between each line of text is about eight pixels. On another Windows 7 PC, the line spacing is about 14 pixels, which pushes the bottom line of text out of visibility in a note.

So my question is really this:

  • Is this caused by different versions of Windows? Everything I could think was different.
  • Is there a way to set this value so that it is consistent across all instances of the application, wherever it works?

Alternatively, is there another component that I could use that can allow me to set this value?

+3
source share
2 answers

TMemo is a descendant of Windows Common controls, and it depends on the current configuration of Windows, so it’s natural to get different results with it.

If you just want to display some information, it is better to use components that allow you to set text positions and their style just like TRichView. This component is not free, but it has its own text rendering engine and allows you to create text with CSS as selectors that look the same in different versions of windows.

+1
source

LMD ElPack ElEdit, . TRichView ElEdit - /, TEdit/TMemo.

+1

Source: https://habr.com/ru/post/1781395/


All Articles