trichview.support
Re: Removing all line breaks |
Author |
Message |
Yoerdes |
Posted: 05/29/2003 18:06:43 Thank you. Pasting nothing isn't an option, I have to past everything in one line. But I found something that works very well so far: TheText := StringReplace(TheText, #13#10 + '\par\', '\', [rfReplaceAll]); Yoerdes Sergey Tkachenko wrote: > You can process OnPaste and allow pasting only one-line text: > > procedure TForm1.RichViewEdit1Paste(Sender: TCustomRichViewEdit; > var DoDefault: Boolean); > var s: String; > begin > s := Clipboard.AsText; > if (Pos(#10,s)=0) and (Pos(#13,s)=0) then > RichViewEdit1.InsertText(s,False); > DoDefault := False; > end; > > The code above does notthing if the text is multiline. > For the user convenience, you can insert the first line, or replace line > breaks with some characters (for example, '|'). > > > >>How can I remove all line breaks from an RTF string that I want to paste >>into an RichViewEdit? >> >>The following is set: >> >>RichViewEdit.EditorOptions := [rvoCtrlJumps, rvoDoNotWantReturns, >>rvoDoNotWantShiftReturns]; >> >>RichViewEdit.Style.ParaStyles[0].Option := [rvpaoNoWrap, >>rvpaoDoNotWantReturns]; >> >>This helps when typing the text, but when I paste text that has line >>breaks, they are still there after pasting. >> >>Regards >>Yoerdes |
Powered by ABC Amber Outlook Express Converter