DataObject.SetText Method (String, TextDataFormat)

Stores text data in this data object. The format of the text data to store is specified with a member of TextDataFormat.

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

public void SetText(
	string textData,
	TextDataFormat format
)

Parameters

textData
Type: System.String

A string that contains the text data to store in the data object.

format
Type: System.Windows.TextDataFormat

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

ExceptionCondition
ArgumentNullException

textData is null.

This method adds data with auto-conversion disabled (the same as calling SetData(String, Object, Boolean) with autoConvert set to false).

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft