Редагувати

Поділитися через


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.

public:
 bool ContainsText();
public bool ContainsText ();
member this.ContainsText : unit -> bool
Public Function ContainsText () As Boolean

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.

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

ContainsText(TextDataFormat)

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

Determines if there is text on the Clipboard.

public:
 bool ContainsText(System::Windows::Forms::TextDataFormat format);
public bool ContainsText (System.Windows.Forms.TextDataFormat format);
member this.ContainsText : System.Windows.Forms.TextDataFormat -> bool
Public Function ContainsText (format As TextDataFormat) As Boolean

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.

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