Dela via


Clipboard.SetContentWithOptions(DataPackage, ClipboardContentOptions) Method

Definition

Sets the content that is stored in the clipboard object with options for the content.

public:
 static bool SetContentWithOptions(DataPackage ^ content, ClipboardContentOptions ^ options);
 static bool SetContentWithOptions(DataPackage const& content, ClipboardContentOptions const& options);
public static bool SetContentWithOptions(DataPackage content, ClipboardContentOptions options);
function setContentWithOptions(content, options)
Public Shared Function SetContentWithOptions (content As DataPackage, options As ClipboardContentOptions) As Boolean

Parameters

content
DataPackage

Contains the content to store in the clipboard. This parameter may not be null.

options
ClipboardContentOptions

An object that specifies options for the clipboard content, such as whether the content is allowed in the clipboard history and whether it will be synced to other devices. This parameter may be null, in which case default options are used.

Returns

Boolean

bool

True if the content was set to the clipboard. False if the content could not be set, for example, because the clipboard is already in use by another process.

Windows requirements

Device family
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v7.0)

Applies to