Hide

SftTabs/OCX 6.5 - Tab Control for VB6

Display
Print

DataObject.Files Property

Returns a collection of filenames used by the sftCFFiles format.

Syntax

Get
VBSet Files = object.Files As DataObjectFiles

object

A DataObject object.

Files

Returns a DataObjectFiles object reference which can be used to access the file names in the collection.

Comments

The Files property returns a collection of filenames used by the sftCFFiles format.

The Files collection is filled with file names only when the DataObject object contains data of type sftCFFiles. The DataObject object can contain several different types of data. You can iterate through the Item property to retrieve the list of file names.

The Files collection can be filled to allow an application to act as a drag source for a list of files (similar to Windows Explorer).

Example

This example uses a list box (List1) which is placed on the same form as the tab control (SftTabs1). By dragging files from Windows Explorer to the tab control, the list box is populated.

Private Sub Form_Load()
    With SftTabs1.Direct
        .OLEDropMode = OLEDropSftControlManual
        .Style = styleSftTabsModernTop
        .ClientArea = False
        .Scrolling.Style = scrollSftTabsAlwaysLeft
        .Scrolling.FullSize = True
        .MakeNaturalSize
    End With
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)
    Dim v As Variant
    With SftTabs1.Direct
        If Data.GetFormat(sftCFFiles) Then
            ' File names - add them to a list box (the list box is on the
            ' same form as the tab control (not inside tab control)
            List1.Clear
            For Each v In Data.Files
                List1.AddItem v
            Next
        End If
    End With
End Sub

See Also DataObject Object | Object Hierarchy


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