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

# TClipboard.SetComponentAsText

Stores the specified Component in the clipboard.

## Declaration

Source position: clipbrd.pp line 221

`public function TClipboard.SetComponentAsText(`
`Component: TComponent`
`):Boolean;`

## Arguments

`Component` |  | Component instance stored to the clipboard in the method.

## Function result

True when no other updates are pending for the clipboard, and its ownership has not changed.

## Description

SetComponentAsText is a Boolean function used to store the specified Component to the TClipboard instance.

SetComponentAsText calls the WriteComponentAsTextToStream routine in the lresources.pp unit to store Component to a TMemoryStream. The String value in the stream is assigned to the AsText property to store the value in the clipboard.

SetComponentAsText calls BeginUpdate prior to storing the component to the clipboard, and EndUpdate when the operation has been completed. The return value for the method is the value returned from EndUpdate.

## See also

TClipBoard.AsText |  | Text stored in the clipboard.
WriteComponentAsTextToStream |  |
TMemoryStream