Clipboard.SetText Method (String, TextDataFormat)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

public static void SetText(
	string text,
	TextDataFormat format
)

Parameters

text
Type: System.String

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

format
Type: System.Windows.TextDataFormat

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

Exception Condition
ArgumentNullException

text is null.

This method adds data with auto-conversion disabled.

.NET Framework
Available since 3.0
Return to top
Show: