TCustomRichView.OnRVFControlNeeded

<< Click to display table of contents >>

TCustomRichView.OnRVFControlNeeded

Occurs when reading inserted control from RVF file or stream, and this control was saved without its "body".

type

  TRVFControlNeededEvent =

    procedure(Sender: TCustomRichView; Name: TRVUnicodeString;

      const Tag: TRVTagvar ctrl: TControl) of object;

 

property OnRVFControlNeeded: TRVFControlNeededEvent;

(changed in version 18)

By default, values of all published properties of controls are saved in RVF documents.

If you exclude rvfoSaveControlsBody from RichView.RVFOptions, none of control properties are saved. Only the item name (value returned by GetItemText) and tag (value returned by GetItemTag) are saved. These values allow to identify the control on loading. When reading such RVF files, OnRVFControlNeeded is called for each control.

 

Input parameters:

Name name of the control's item (this is a value returned by GetItemTextW; do not confuse with Name property of controls, see Item types).

Tag tag of the control's item (this is a value returned by GetItemTag; do not confuse with Tag property of controls, see "Tags").

Output parameter:

ctrl control to insert in document. Create this control in this event. Do not destroy it (RichView will destroy it when necessary).

 

See also:

RVF overview, contains example.