Clipboard.SetText Clipboard.SetText Clipboard.SetText Clipboard.SetText Method

Definition

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

Overloads

SetText(String) SetText(String) SetText(String) SetText(String)

Stores UnicodeText data on the Clipboard.

SetText(String, TextDataFormat) SetText(String, TextDataFormat) SetText(String, TextDataFormat) 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) SetText(String) SetText(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 String String String

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

Exceptions

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

SetText(String, TextDataFormat) SetText(String, TextDataFormat) SetText(String, TextDataFormat) 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 String String String

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

format
TextDataFormat TextDataFormat TextDataFormat TextDataFormat

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

Exceptions

Remarks

This method adds data with auto-conversion disabled.

See also

Applies to