[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'Clipbrd' (#lcl)

TClipboard.GetComponentAsText

Loads a component instance from a textual representation stored in the clipboard.

Declaration

Source position: clipbrd.pp line 205

public procedure TClipboard.GetComponentAsText(

  var RootComponent: TComponent;

  OnFindComponentClass: TFindComponentClassEvent;

  Owner: TComponent = Nil;

  Parent: TComponent = Nil

);

Arguments

RootComponent

  

Variable argument where the component loaded from the clipboard is stored.

OnFindComponentClass

  

Routine used to the locate the component class reference need to create a new component instance.

Owner

  

Owner of the newly created component instance.

Parent

  

Parent for the newly created component instance.

Description

GetComponentAsText creates a temporary TMemoryStream used to load the pcfText clipboard content returned by AsText. ReadComponentFromTextStream (in lresources.pp) is called to get the component class reference needed to instantiate and load the component in RootComponent. Owner and Parent contain the values stored to the corresponding properties in the newly created component instance.

Use GetComponent to create and load a component instance from a pcfComponent format stored in the clipboard.

Use SetComponentAsText and SetComponent to store a component instance to the clipboard using with the pcfText or pcfComponent format.

Use SupportedFormats to determine which storage formats are supported in the clipboard.

See also

TClipboard.AsText

  

Text stored in the clipboard.

TClipboard.SupportedFormats

  

Gets the list of supported formats for the clipboard.

TClipboard.SetComponent

  

Writes the specified component to the storage for the Clipboard format.

TClipboard.SetComponentAsText

  

Stores the specified Component in the clipboard.

ReadComponentFromTextStream

  


Version 4.0 Generated 2025-05-03 Home