Edit

Share via


Clipboard.SetText Method

Definition

Stores text data on the Clipboard. The text data to store is specified as a string.

Overloads

SetText(String)

Stores UnicodeText data on the Clipboard.

SetText(String, TextDataFormat)

Stores text data on the Clipboard in a specified text data format. The UnicodeText data to store is specified as a string.

SetText(String)

Stores UnicodeText data on the Clipboard.

public:
 static void SetText(System::String ^ text);
public static void SetText (string text);
static member SetText : string -> unit
Public Shared Sub SetText (text As String)

Parameters

text
String

A string that contains the UnicodeText data to store on the Clipboard.

Exceptions

text is null.

Remarks

This data format denotes 16-bit character encoded Unicode, also referred to as UTF-16, and UCS-2.

This method adds data with auto-conversion disabled.

See also

Applies to

SetText(String, TextDataFormat)

Stores text data on the Clipboard in a specified text data format. The UnicodeText data to store is specified as a string.

public:
 static void SetText(System::String ^ text, System::Windows::TextDataFormat format);
public static void SetText (string text, System.Windows.TextDataFormat format);
static member SetText : string * System.Windows.TextDataFormat -> unit
Public Shared Sub SetText (text As String, format As TextDataFormat)

Parameters

text
String

A string that contains the text data to store on the Clipboard.

format
TextDataFormat

A member of TextDataFormat that specifies the specific text data format to store.

Exceptions

text is null.

Remarks

This method adds data with auto-conversion disabled.

See also

Applies to