DataFormats.UnicodeText Field


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

Specifies the standard Windows Unicode text format. This static field is read-only.

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

public static readonly string UnicodeText

Field Value

Type: System.String

This field is used by the IDataObject interface and the DataObject class to specify the data type.

When adding to an IDataObject or to an implementation of DataObject, use this field as the format for the IDataObject.SetData and DataObject.SetData methods.

To see if an object of this type exists, use this field as the format for the IDataObject.GetDataPresent and DataObject.GetDataPresent methods.

To get an object of this type, use this as the format for the IDataObject.GetData and DataObject.GetData methods.

The following code example demonstrates the use of this member.


	String myString = "This is a String from the ClipBoard";

	// Sets the data into the Clipboard.
	IDataObject myDataObject = Clipboard.GetDataObject();
	// Checks whether the format of the data is 'UnicodeText' or not.
		Console.WriteLine("Data in 'UnicodeText' format:"+myDataObject.GetData(DataFormats.UnicodeText));
		Console.WriteLine("No String information was contained in the clipboard.");

	// Checks whether the format of the data is 'Text' or not.
		String clipString = (String)myDataObject.GetData(DataFormats.StringFormat);
		Console.WriteLine("Data in 'Text' format:"+clipString);
catch(Exception e)

.NET Framework
Available since 1.1
Return to top