Hide

SftTabs/OCX 6.5 - Tab Control for VB6

Display
Print

DataObjectFiles.Item Property

Returns a specific filename by index from the DataObject.Files collection (sftCFFiles format only).

Syntax

Get
VBItem = object.Item(ByVal ItemIndex As Long) As String

object

A DataObjectFiles object.

ItemIndex

The one-based position of the file name to be retrieved.

Item

Returns the file name at position ItemIndex in the Files collection of a DataObject object (sftCFFiles format only).

Comments

The Item property returns a specific filename by index from the DataObject.Files collection (sftCFFiles format only).

This property can be used to retrieve file names from the Files collection.

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
            List1.AddItem Data.Files.Count & " files"
            For Each v In Data.Files
                List1.AddItem v
            Next
        End If
    End With
End Sub

See Also DataObjectFiles Object | Object Hierarchy


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