HeaderPane
Main
Hide
Share Link
Print

Files Property, DataObject Object

Returns a collection of filenames used by the sftCFFiles format.

Syntax

Get

C#DataObjectFiles Files = object.Files;
VB.NETFiles = object.Files As DataObjectFiles
C++IVDMDataObjectFiles* Files = object->Files;
IVDMDataObjectFiles* Files = object->GetFiles();
CHRESULT object->get_Files(struct IVDMDataObjectFiles** Files);

object

A DataObject object.

Files

Returns a collection of filenames used by the sftCFFiles format.

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).

Examples

C# View entire sample code

                int itemIndex = comboTarget.Items.Insert("A Bitmap", comboTarget.Items.DropIndex);
                object o = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap);
                comboTarget.get_Item(itemIndex).Image.Picture = o as stdole.IPictureDisp;
                comboTarget.Items.Selection = itemIndex;
            }
            if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFFiles)) {
                int itemIndex = -1;
                int toIndex = comboTarget.Items.DropIndex;
                foreach (string s in e.data.Files) {
                    itemIndex = comboTarget.Items.Insert(s, toIndex);
                    toIndex = toIndex + 1;
                }
                comboTarget.Items.Selection = itemIndex;
            }
            comboTarget.Columns.MakeOptimal(0);
            comboTarget.Items.RecalcHorizontalExtent(0);

VB.NET View entire sample code

        Dim o As Object = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap)
        comboTarget.get_Item(itemIndex).Image.Picture = o 'as stdole.IPictureDisp
        comboTarget.Items.Selection = itemIndex
    End If
    If e.data.GetFormat(SftOLEClipboardConstants.sftCFFiles) Then
        Dim itemIndex As Integer = -1
        Dim toIndex As Integer = comboTarget.Items.DropIndex
        Dim s As String
        For Each s In e.data.Files
            itemIndex = comboTarget.Items.Insert(s, toIndex)
            toIndex = toIndex + 1
        Next
        comboTarget.Items.Selection = itemIndex
    End If
    comboTarget.Columns.MakeOptimal(0)
    comboTarget.Items.RecalcHorizontalExtent(0)

See Also DataObject Object | Object Hierarchy


Last Updated 11/22/2026 - (email)
© 2026 Softel vdm, Inc.