TRichEdit - problem with last line
Posted on 2009-04-01
I have an annoying issue with TRichEdit. I'm not sure how to solve it.
I have a TRichEdit control and the size is h:60 w:240. this should be enough for 4 lines of text.
RE.Lines.Add('2222 2222 222 222 2 2222 222222 2222 2222 222222 22222222 222 2222');
this means it should extend '222...' into 2 lines, which it does correctly, due to width of control.
The problem is that after inserting '4' into 4th line, it creates NEW LINE! and now it moves all lines up so the first line is not visible anymore! Obviously with new line, there are now 5 lines.
So, instead of :
(and new empty line)
Because of new empty line the first line gest pushed up (out of the visible area).
I can move up I can get the first line to appear in control, but I would like to have it visible from the beginning.
So, it appears that:
ads new line after the inserted line.
How can I avoid this?