IDataObject.GetDataPresent Method

   
IDataObject.GetDataPresent Method

Class

System.Windows.Forms.IDataObject

Syntax

 GetDataPresent(   format   [,   autoconvert   ]) 
format (required; String or Type object)

Field member of the DataFormats class (see later for more information on this) or a Type object representing the format of the data for which to search

autoconvert (optional; Boolean)

True to convert the data to the specified format

Return value

Boolean value indicating whether the Clipboard holds data of the specified format or of a format that can be converted to format

Description

Returns a Boolean value indicating whether the Clipboard holds data of the specified format or of a format that the present data can be converted to

Rules at a Glance

  • The format argument can be one of the following string values:

    DataFormats.Bitmap
    DataFormats.CommaSeparatedValue
    DataFormats.Dib
    DataFormats.Dif
    DataFormats.EnhancedMetafile
    DataFormats.FileDrop
    DataFormats.Html
    DataFormats.Locale
    DataFormats.MetafilePict
    DataFormats.OemText
    DataFormats.Palette
    DataFormats.PenData
    DataFormats.Riff
    DataFormats.Rtf
    DataFormats.Serializable (a format that encapsulates any type of Windows Forms object)
    DataFormats.StringFormat
    DataFormats.SymbolicLink
    DataFormats.Text
    DataFormats.Tiff
    DataFormats.UnicodeText
    DataFormats.WaveAudio
  • If format is a string, the autoconvert argument can be supplied in the method call. A value of False indicates that the function should determine whether the data stored by the IDataObject instance is in the format defined by format ; a value of True indicates that the function should determine whether the data stored by the IDataObject instance is in or is capable of being converted to the format defined by format .

Example

The following code will inform us whether the Clipboard contains a bitmap:

 Dim di As IDataObject di = clipboard.GetDataObject MsgBox(di.GetDataPresent(Dataformats.Bitmap)) 

See Also

IDataObject.GetData Method, IDataObject.GetFormats Method

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net