property ExDataObjectFiles.Item (Index as Long) as String

Returns a specific file name given its index.

TypeDescription
Index as Long A long expression that indicates the filename's index.
String A string value that indicates the filename

The Item property gets a file giving its index. The Count property counts the number of files in the collection. Use the Files property to retrieve the filenames if the format of data is exCFiles. The OLEDragDrop event notifies your application that the user drags some data on the control. Use the GetFormat property to retrieve the type of data being carried by the drag and drop data source.

The following VB sample displays the list of files being dragged to the control ( open your Windows Explorer, select some files and drag them to the control ) :

Private Sub ExFileView1_OLEDragDrop(ByVal Data As EXFILEVIEWLibCtl.IExDataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    With Data.Files
        Dim i As Long
        For i = 0 To .Count - 1
            Debug.Print .Item(i)
        Next
    End With
End Sub

The following C++ sample displays the list of files being dragged to the control:

#import <exfilevw.dll>
void OnOLEDragDropExfileview1(LPDISPATCH Data, long FAR* Effect, short Button, short Shift, long X, long Y) 
{
	EXFILEVIEWLib::IExDataObjectPtr spData( Data );
	if ( spData )
	{
		EXFILEVIEWLib::IExDataObjectFilesPtr spFiles = spData->Files;
		for ( long i = 0; i < spFiles->Count; i++ )
			OutputDebugString( spFiles->Item[ i ] );
	}
}

The C++ requires #import <exfilevw.dll> to import definitions for ExDataObject and ExDataObjectFiles objects. The #import <exfilevw.dll> generates the EXFILEVIEWLib namespace. If the exfilevw.dll file is located in other directory than system folder, the correct path should be provided, else a compiler error occurs.

The following VB.NET sample displays the list of files being dragged to the control:

Private Sub AxExFileView1_OLEDragDrop(ByVal sender As Object, ByVal e As AxEXFILEVIEWLib._IExFileViewEvents_OLEDragDropEvent) Handles AxExFileView1.OLEDragDrop
    With e.data.Files
        Dim i As Long
        For i = 0 To .Count - 1
            Debug.WriteLine(.Item(i))
        Next
    End With
End Sub

The following C# sample displays the list of files being dragged to the control:

private void axExFileView1_OLEDragDrop(object sender, AxEXFILEVIEWLib._IExFileViewEvents_OLEDragDropEvent e)
{
	EXFILEVIEWLib.ExDataObjectFiles files = e.data.Files;
	for (int i = 0; i < files.Count; i++)
		System.Diagnostics.Debug.WriteLine(files[i]);
}

The following VFP sample displays the list of files being dragged to the control:

*** ActiveX Control Event ***
LPARAMETERS data, effect, button, shift, x, y

With data.Files
    local i
    For i = 0 To .Count - 1
        wait window nowait .Item(i)
    Next
EndWith