1
votes

Is it possible to make TMemo show partially visible lines? I'm looking for a native way to do that, without custom rendering.

I made an example screenshot for those who not familiar with this issue:

MemoPartialVisibilityExample

As you can see,, in the area I marked with red, there is enough space to display some part of the next line that is not visible by default.

There are some components, like TListBox, which show partially visible lines, so I want to make TMemo do the same.

P.S. I'm not interested in other suggestions, like enlarging the TMemo size, that's off-topic.

2
How would you display partially visible lines? They're partially visible because there's not enough room to fully display them. Please edit your question to make it more clear what you're asking, because what you've asked here makes no sense.Ken White
Set the scrollbars visible, then you can scroll to make them visible. Alternatively you can navigate in the memo with the arrow keys for instance.Sertac Akyuz
Honestly, I'm not sure why all the down-votes here. This is a perfectly legitimate question. OP has a problem, which is clearly stated, and at least I understand it clearly. Even an example of desired behavior is in the question. Just because "that's by design" is technically the answer, doesn't mean the question isn't valid, or useful, or well-thought.Jerry Dodge
@Jerry: TMemo does not support custom drawing, so an answer of it's not possible is correct. If your suggestion is to develop an entirely new control not based on TMemo to accomplish this, that's fine, but it does not change the fact that TMemo (or the underlying Windows edit control) does not support it.Ken White
Why do you guys always take every little word so literally and use it against me on everything I say? Jeez, no wonder people hate this site.Jerry Dodge

2 Answers

2
votes

It's not possible to make a TMemo to show partial lines. For what you can do natively to a memo, which is a multiline edit control, see edit controls on MSDN.

0
votes

You could use a TRichEdit instead.

You can access the Lines and Text properties, just like for a TMemo. It also has the WordWrap, ReadOnly and ScrollBars properties, just like TMemo, so it could be a drop-in replacement, but showing partial lines at the bottom as required.

Tested in Delphi 10.1 Berlin as well.

enter image description here