Bewerken

Share via


DataObject.SetText Method

Definition

Adds text data to the data object.

Overloads

SetText(String, TextDataFormat)

Adds text data to the data object in the format indicated by the specified TextDataFormat value.

SetText(String)

Adds text data to the data object in the UnicodeText format.

SetText(String, TextDataFormat)

Adds text data to the data object in the format indicated by the specified TextDataFormat value.

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

Parameters

textData
String

The text to add to the data object.

format
TextDataFormat

One of the TextDataFormat values.

Exceptions

textData is null or Empty.

format is not a valid TextDataFormat value.

Remarks

To retrieve text data from the data object, first use the ContainsText method to determine whether the data object contains image data before retrieving it with the GetText method.

See also

Applies to

SetText(String)

Adds text data to the data object in the UnicodeText format.

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

Parameters

textData
String

The text to add to the data object.

Exceptions

textData is null or Empty.

Remarks

To retrieve text data from the data object, first use the ContainsText method to determine whether the data object contains image data before retrieving it with the GetText method.

See also

Applies to