delphifiremonkeydelphi-10.2-tokyo

FMX TMemo Doesn't Show Blank Line


I'm working with Delphi 10.2 (Tokyo). The FMX TMemo does not render blank lines. For instance, copy the following and paste it onto the form of a FMX application (Win32 Target).

object Memo1: TMemo
  Lines.Strings = (
    'One'
    ''
    'Three')
end

The 2nd line is not rendered at design-time, or run-time. If a space is typed on the blank line, then the blank line is rendered. It behaves very much like HTML in a web browser (blank lines without a space are not rendered).

Is there a way to cause the TMemo component to render blank lines? Is it as simple as setting the style? If so, how do I do that? (I am very new to FMX.)

I would prefer to not alter the content and add a space to blank lines just to get it to render them. I would rather fix the root issue.

As a second issue, which will be fixed by fixing the first issue, if a user presses Enter in a TMemo field at run-time, it doesn't move the cursor down to the next line unless they first type a space on the line they want to leave blank. This will be VERY frustrating to users.


Solution

  • The issue occurs when themes are not enabled. The same app that exhibits problems works just fine after themes are turned on.

    I have reported this bug to Embarcadero.


    Edit :: Jan 13, 2021

    If you change TMemo.ControlType = Styled to Platform, then it will render tabs and CRLF correctly on Windows, even when themes are disabled, or when Zoom or GoToMeeting change the theme to Basic.


    Edit :: Aug 7, 2021

    Change the ControlType = Platform to also fix an annoying issue where tabs aren't rendered correctly on Windows 7 unless you [x] Use visual styles on windows and buttons (found under "System Properties | Advanced | Performance | Settings | Visual Effects").