trichview.support
Re: Removing all line breaks |
Author |
Message |
Sergey Tkachenko |
Posted: 05/29/2003 13:39:00 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