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

# TClipboard.SetFormat

Sets the clipboard format to the specified identifier and copies the value in Stream.

## Declaration

Source position: clipbrd.pp line 222

`public function TClipboard.SetFormat(`
`FormatID: TClipboardFormat;`
`Stream: TStream`
`):Boolean;`

## Arguments

`FormatID` |  | Format identifier needed for the specified stream.
`Stream` |  | Stream with the content loaded in the method.

## Description

SetFormat is a Boolean function used to select the clipboard format for the format identifier in FormatID, and load the content in Stream. It calls AddFormat to select the supported format in FormatID, and to cache values in Stream to its TClipboardData record instance.

SetFormat calls BeginUpdate prior to activating the format and loading its value. It calls EndUpdate when the operation has been completed. The value from EndUpdate is used as the return value for the method.

SetFormat is called when TGraphic or TPicture class instances are loaded to the clipboard in the Assign method.

## See also

TClipBoard.AddFormat |  | Acquires ownership of the Clipboard and adds a format.
TClipBoard.Assign |  | Copies properties from the specified persistent object to the clipboard.
TClipboardFormat |  | Alias for the PtrUInt type.