Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

ContainsData Method

Location

My.Computer.Clipboard.ContainsData

Syntax

Dim result As Boolean = My.Computer.Clipboard.ContainsData(format)

format (required; String)

The name of the data type to look for on the clipboard

Description

The ContainsData method indicates whether the system clipboard contains the named custom format of data (true) or not (False).

Usage at a Glance

  • This method is only valid in non-server applications.

  • Security restrictions in place for the active user may limit access to the system clipboard.

Example

The following example checks the clipboard for data in the "MozartMusic" format.

If My.Computer.Clipboard.ContainsData("MozartMusic") Then MsgBox("Found classical music.") End If

Related Framework Entries

  • Microsoft.VisualBasic.MyServices.ClipboardProxy.ContainsData Method

  • System.Windows.Forms.Clipboard.ContainsData Method

See Also

Clipboard Object, ContainsAudio Method, ContainsFileDropList Method, ContainsImage Method, ContainsText Method, GetData Method, SetData Method

Категории