DataFormats.GetDataFormat Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a DataFormat object that defines a name and numeric ID for a specified data format.
Overloads
GetDataFormat(Int32) |
Returns a DataFormat object that defines a name and numeric ID for the specified data format. The desired data format is specified by numeric ID. |
GetDataFormat(String) |
Returns a DataFormat object that defines a name and numeric ID for the specified data format. The desired data format is specified by name (a string). |
Remarks
This method can also be used to register new formats. If the specified format cannot be found, it is automatically registered as a new data format.
GetDataFormat(Int32)
Returns a DataFormat object that defines a name and numeric ID for the specified data format. The desired data format is specified by numeric ID.
public:
static System::Windows::DataFormat ^ GetDataFormat(int id);
public static System.Windows.DataFormat GetDataFormat (int id);
static member GetDataFormat : int -> System.Windows.DataFormat
Public Shared Function GetDataFormat (id As Integer) As DataFormat
Parameters
- id
- Int32
The numeric ID of the data format to request a DataFormat object for.
Returns
A DataFormat object that contains the numeric ID and the name of the requested data format.
Remarks
This method can also be used to register new formats. If the specified format cannot be found, it is automatically registered as a new data format.
Applies to
GetDataFormat(String)
Returns a DataFormat object that defines a name and numeric ID for the specified data format. The desired data format is specified by name (a string).
public:
static System::Windows::DataFormat ^ GetDataFormat(System::String ^ format);
[System.Security.SecurityCritical]
public static System.Windows.DataFormat GetDataFormat (string format);
public static System.Windows.DataFormat GetDataFormat (string format);
[<System.Security.SecurityCritical>]
static member GetDataFormat : string -> System.Windows.DataFormat
static member GetDataFormat : string -> System.Windows.DataFormat
Public Shared Function GetDataFormat (format As String) As DataFormat
Parameters
- format
- String
The name of the data format to request a DataFormat object for.
Returns
A DataFormat object that contains the numeric ID and the name of the requested data format.
- Attributes
Exceptions
format
is null
.
Remarks
This method can also be used to register new formats. If the specified format cannot be found, it is automatically registered as a new data format.
See also
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈