0

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.

James L.
  • 9,384
  • 5
  • 38
  • 77
  • What happens if you add those lines in the designer? – Rudy Velthuis Oct 01 '17 at 08:06
  • @RudyVelthuis - You can see the blank lines in the designer, but when you click `OK`, the blank lines are not rendered in the `TMemo` component. If you then run the app, they are not rendered at run-time either. – James L. Oct 01 '17 at 08:13
  • I don't have D 10.2 Tokyo installed, but testing with D 10.1 Berlin and earlier XE7 i could not reproduce the described error. Could you please confirm that this error *only* occurs in D 10.2 ? – Tom Brunberg Oct 01 '17 at 09:26
  • To add to what @TomBrunberg has said, I can't reproduce this on a newly created FMX form in Seattle or Tokyo. I get the empty lines correctly rendered. – MartynA Oct 01 '17 at 09:29
  • Same thing no error on seattle. How are you getting this – Nasreddine Galfout Oct 01 '17 at 12:37
  • I can't reproduce it either. Even unpacked my laptop (am on vacation) to check . – Rudy Velthuis Oct 01 '17 at 15:31
  • try to set the style to native to see it's it's help – zeus Oct 01 '17 at 16:10
  • I also cannot reproduce in 10.2 – Dsm Oct 02 '17 at 08:42
  • Your comments made me consider other factors (outside of Delphi). You are all right. It works on Delphi 10.2 on Windows 10, but it does not work when Delphi is installed on WinSvr2008R2. I'll post as an answer. Thanks again for trying it and commenting, especially @RudyVelthuis who did so on vacation . – James L. Oct 02 '17 at 16:47

1 Answers1

0

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").

James L.
  • 9,384
  • 5
  • 38
  • 77