rvico TRichView Reference | TRichViewEdit


Top  Previous  Next

Allows to paste data from the Clipboard in custom formats.


  TRVPasteEvent = 

    procedure (Sender: TCustomRichViewEdit;

               var DoDefault: Boolean) of object;


property OnPaste: TRVPasteEvent;

(introduced in version 1.3)

Occurs before any data are pasted in editor (Paste method, or  Ctrl + V  /  Shift + Insert ).

You can insert data in your own format here and/or forbid default pasting procedure (set DoDefault to False).

Note: see standard priorities of formats for pasting in Paste method.


Example (allowing to paste only one line of plain text):

procedure TMyForm.MyRichViewEditPaste(Sender: TCustomRichViewEdit;

  var DoDefault: Boolean);

var s: String;


  s := Clipboard.AsText;

  if (Pos(#10,s)=0and (Pos(#13,s)=0then


  DoDefault := False;



See also:

RichView and Clipboard;
How to make a plain text editor.

TRichView © trichview.com