Hide

SftTabs/OCX 6.5 - Tab Control for VB6

Display
Print

DataObject.GetFormat Method

Determines if a specified clipboard format is supported by the DataObject object.

Syntax

VBFormatSupported = object.GetFormat(ByVal Format As Integer) As Boolean

object

A DataObject object.

Format

The data format requested.

FormatValueDescription
sftCFText1Text
sftCFBitmap2Bitmap
sftCFMetafile3Metafile
sftCFDIB8Device independent bitmap
sftCFFiles15List of files.
sftCFRTF-16639Rich text format

FormatSupported

Returns True if the specified clipboard format Format is supported by the DataObject object, otherwise False is returned.

Comments

The GetFormat method determines if a specified clipboard format is supported by the DataObject object.

The GetFormat method returns True if a data format in the DataObject object matches the specified format. Otherwise, it returns False.

Example

This example uses a picture box (Picture1) which is placed on the same form as the tab control (SftTabs1). A valid bitmap or icon has to be loaded into the picture box (Picture property). By dragging the image from the picture box to a tab of the tab control, the image is added to the tab as tab graphic.

Private Sub Form_Load()
     Picture1.OLEDragMode = OLEDragSftControlManual
     SftTabs1.OLEDropMode = OLEDropSftControlManual
End Sub

Private Sub SftTabs1_OLEDragDrop(Data As SftTabsLib.DataObject, TargetTab As Integer, _
     Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
     With SftTabs1.Direct
         If Data.GetFormat(sftCFDIB) Then
             ' Bitmap
             If TargetTab >= 0 Then
                 Set .Tab(TargetTab).Image.Picture = Data.GetData(sftCFDIB)
             End If
         End If
     End With
End Sub

Private Sub SftTabs1_OLEDragOver(Data As SftTabsLib.DataObject, TargetTab As Integer, _
     Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, _
     State As SftTabsLib.SftControlOLEDragOverConstants)
     If TargetTab >= 0 Then
         Effect = vbDropEffectCopy
     Else
         Effect = vbDropEffectNone
     End If
End Sub

See Also DataObject Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.