DataObject.GetFormats Method (Boolean)

 

Returns a list of all formats that data stored in this DataObject is associated with or can be converted to, using an automatic conversion parameter to determine whether to retrieve only native data formats or all formats that the data can be converted to.

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

abstract GetFormats : 
        autoConvert:bool -> string[]
override GetFormats : 
        autoConvert:bool -> string[]

Parameters

autoConvert
Type: System.Boolean

true to retrieve all formats that data stored in this DataObject is associated with, or can be converted to; false to retrieve only native data formats.

Return Value

Type: System.String[]

An array of type String, containing a list of all formats that are supported by the data stored in this object.

Call this method to get the supported data formats before calling GetData. See DataFormats for the predefined formats.

System_CAPS_noteNote

Data can be converted to another format if it was stored specifying that conversion is allowed and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text.

The following code example queries a DataObject for the formats associated with its data. The first query specifies the autoConvert parameter as false, so only the native format of the data is returned. The second query specifies the autoConvert parameter as true, so the list of formats includes the formats that the data can be converted to.

This code requires that textBox1 has been created.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: