Topic: How can I copy one line of RichEdit component

Please, anyone can give me advice on how to make a copy full of one first line of RichEdit component to TextBox?
For example, here I can Copy 30 letters of the first line but not a full line.

frmNewNote.EdTitle.Text := Copy(frmNewNote.RichEdit1.Text,0,30);    ///Copy 30 letters

What I should change in my script? Thank you very much in advance

2 (edited by pavlenko.vladimir.v 2022-08-23 10:06:55)

Re: How can I copy one line of RichEdit component

Form1.RichEdit1.lines[i]

в MVD не работает
does not work

Re: How can I copy one line of RichEdit component

I am Following your advice but no work?

4 (edited by k245 2022-08-26 08:05:01)

Re: How can I copy one line of RichEdit component

Clarification required. If you want to copy a line that ends with a CR, then it is possible: just find the position of this character and copy the fragment.


copy( Form3.RichEdit1.Text, 1, pos(chr(13), Form3.RichEdit1.Text ))

But if we are talking about the displayed line, which was formed as a result of the text wrapping algorithm, then nothing will come of it.


http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=8983&download=0

Post's attachments

Attachment icon пример.png 24.09 kb, 64 downloads since 2022-08-26 

Визуальное программирование: блог и телеграм-канал.

Re: How can I copy one line of RichEdit component

You are the Champion, with your code working very well

copy( Form3.RichEdit1.Text, 1, pos(chr(13), Form3.RichEdit1.Text ))

Thank you very much K245