Edit

Share via


DataObject.SetText Method

Definition

Stores text data, specified as a string, in this data object.

Overloads

SetText(String, TextDataFormat)

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

SetText(String)

Stores UnicodeText data, specified as a string, in this data object.

SetText(String, TextDataFormat)

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

public:
 void SetText(System::String ^ textData, System::Windows::TextDataFormat format);
public void SetText(string textData, System.Windows.TextDataFormat format);
member this.SetText : string * System.Windows.TextDataFormat -> unit
Public Sub SetText (textData As String, format As TextDataFormat)

Parameters

textData
String

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

format
TextDataFormat

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

Exceptions

textData is null.

Remarks

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

See also

Applies to

SetText(String)

Stores UnicodeText data, specified as a string, in this data object.

public:
 void SetText(System::String ^ textData);
public void SetText(string textData);
member this.SetText : string -> unit
Public Sub SetText (textData As String)

Parameters

textData
String

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

Exceptions

textData is null.

Remarks

This data format denotes 16-bit character encoded Unicode, also referred to as UTF-16, and USC-2.

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

See also

Applies to