ClipboardProxy.ContainsText Method

Definition

Determines if there is text on the Clipboard.

Overloads

ContainsText()

Determines if there is text on the Clipboard.

ContainsText(TextDataFormat)

Determines if there is text on the Clipboard.

ContainsText()

Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb

Determines if there is text on the Clipboard.

C#
public bool ContainsText();

Returns

True if the Clipboard contains text; otherwise False.

Examples

This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does.

VB
If My.Computer.Clipboard.ContainsText(
   System.Windows.Forms.TextDataFormat.Html) Then

   Dim clipText = My.Computer.Clipboard.GetText()
End If

Remarks

Possible formats are CommaSeparatedValue, Html, Rtf and UnicodeText.

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library No
Windows Service Yes
Web Site No

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 5, 6, 7, 8, 9, 10

ContainsText(TextDataFormat)

Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb
Source:
ClipboardProxy.vb

Determines if there is text on the Clipboard.

C#
public bool ContainsText(System.Windows.Forms.TextDataFormat format);

Parameters

format
TextDataFormat

TextDataFormat. If specified, identifies what text format to be checked for. Required.

Returns

True if the Clipboard contains text; otherwise False.

Examples

This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does.

VB
If My.Computer.Clipboard.ContainsText(
   System.Windows.Forms.TextDataFormat.Html) Then

   Dim clipText = My.Computer.Clipboard.GetText()
End If

Remarks

Possible formats are CommaSeparatedValue, Html, Rtf and UnicodeText.

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library No
Windows Service Yes
Web Site No

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 5, 6, 7, 8, 9, 10