Export (0) Print
Expand All

DataObject.GetText Method (TextDataFormat)

Retrieves text data from the data object in the format indicated by the specified TextDataFormat value.

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

public virtual string GetText(
	TextDataFormat format


Type: System.Windows.Forms.TextDataFormat

One of the TextDataFormat values.

Return Value

Type: System.String
The text data in the data object or String.Empty if the data object does not contain data in the specified format.


format is not a valid TextDataFormat value.

Use the ContainsText method to determine whether the data object contains text data before retrieving it with this method.

Use the SetText method to add text data to the data object.

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft