Board index » delphi » Memo - last line

Memo - last line

Hi all,
I have a big problem regarding memos. No matter how many lines I add (with
.add or .append), the last line is always empty, wich looks pretty stupid.
eg. I have a memo which should theoretically be able to display 4 lines. If
I add 4 lines, the scrollbar appears, the last line is free.
The problem doesn't seem to depend on the fontsize, if I add 4 lines through
the property strings in the object inspector, all of them are displayed.
Does anyone know how to solve the problem?

Thanks,
Nico

 

Re:Memo - last line


I'm not sure on the blank line, but what if you set it's ScrollBars :=
ssNone.

Or if you always want it to fit in a certain area,
TLabel.WordWrap := True;
TLabel.AutoSize := False;
TLabel.Caption := 'Line1' + #13 + 'Line 2' + #13 + 'Line 3' + #13 + 'Line
4';

"Nico S. Beck" <f...@mich.doch> wrote in message
news:3da2d68f@newsgroups.borland.com...

Quote
> Hi all,
> I have a big problem regarding memos. No matter how many lines I add (with
> .add or .append), the last line is always empty, wich looks pretty stupid.
> eg. I have a memo which should theoretically be able to display 4 lines.
If
> I add 4 lines, the scrollbar appears, the last line is free.
> The problem doesn't seem to depend on the fontsize, if I add 4 lines
through
> the property strings in the object inspector, all of them are displayed.
> Does anyone know how to solve the problem?

> Thanks,
> Nico

Re:Memo - last line


Quote
In article <3da2d...@newsgroups.borland.com>, Nico S. Beck wrote:
> I have a big problem regarding memos. No matter how many lines I add (with
> ..add or .append), the last line is always empty, wich looks pretty stupid.

Lines.Add always adds a linebreak. Try this:

 memo.selstart := memo.gettextlen;
 memo.seltext := 'This is the last line';

This way there is no linebreak at the end of the last line.

--
Peter Below (TeamB)  
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Re:Memo - last line


Hi Peter,

thank you very much!

Nico

"Peter Below (TeamB)" <100113.1...@compuXXserve.com> schrieb im Newsbeitrag

Quote
> Lines.Add always adds a linebreak. Try this:

>  memo.selstart := memo.gettextlen;
>  memo.seltext := 'This is the last line';

> This way there is no linebreak at the end of the last line.

Other Threads