Builds and gets the collection of File objects of the given type.
Type | Description | |||
Type as TypeEnum | Use SelItems to get the collection of selected files/folder, or AllItems for retrieving the entire collection of files/folders. | |||
Files | A Files collection that contains files based on the specified type. |
Use the HasCheckBox property to assign a check box for each item in your control. Use the BrowseFolderPath property to specify the path to the browsed folder. Use the Name property to specify the name of the file or folder. Use the FullName property to get the full name of the file or folder. Use the Folder property to specify whether the File object hosts a file or a folder.
Use the Get method to retrieve :
The File.Children property helps you to collect recursively all files/folders of specified object. The EnumR function displays the full name of each file/folder, and goes recursively to each subfolder. Use the Folder property to specify whether the File object hosts a file or a folder. The Children property returns a collection of File objects, if the ExpandFolders property is True.
Public Sub EnumR(ByVal f As EXFILEVIEWLibCtl.File) Debug.Print f.FullName For Each c In f.Children EnumR (c) Next End Sub
The following VB sample displays the list of files as they are displayed:
With ExFileView1.Get(VisibleItems) For i = 0 To .Count - 1 With .Item(i) Debug.Print .Name End With Next End With
The following VB enumerates the selected files and folders:
Dim i As Long With ExFileView1.Get(SelItems) For i = 0 To .Count - 1 Debug.Print .Item(i).FullName Next End With
The following C++ sample displays the list of files as they are displayed:
CFiles files = m_fileview.GetGet( 3 /*VisibleItems*/ ); for ( long i = 0; i < files.GetCount(); i++ ) OutputDebugString( files.GetItem( COleVariant( i ) ).GetName() );
The following C++ enumerates the selected files and folders:
CFiles files = m_fileview.GetGet( 0 /*SelItems*/ ); for ( long i = 0; i < files.GetCount(); i++ ) OutputDebugString( files.GetItem( COleVariant( i ) ).GetFullName() );
The following VB.NET sample displays the list of files as they are displayed:
With AxExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.VisibleItems) Dim i As Integer For i = 0 To .Count - 1 With .Item(i) Debug.WriteLine(.Name()) End With Next End With
The following VB.NET enumerates the selected files and folders:
With AxExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.SelItems) Dim i As Integer For i = 0 To .Count - 1 Debug.WriteLine(.Item(i).FullName) Next End With
The following C# sample displays the list of files as they are displayed:
EXFILEVIEWLib.Files files = axExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.VisibleItems); for (int i = 0; i < files.Count; i++) { EXFILEVIEWLib.File file = files[i]; System.Diagnostics.Debug.WriteLine(file.Name); }
The following C# enumerates the selected files and folders:
EXFILEVIEWLib.Files files = axExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.SelItems); for (int i = 0; i < files.Count; i++) { EXFILEVIEWLib.File file = files[i]; System.Diagnostics.Debug.WriteLine(file.FullName); }
The following VFP sample displays the list of files as they are displayed:
With thisform.ExFileView1.Get(3) && VisibleItems For i = 0 To .Count - 1 With .Item(i) wait window nowait .Name EndWith Next EndWith
The following VFP enumerates the selected files and folders:
with thisform.ExFileView1.Get( 0 ) && SelItems local i for i = 0 to .Count - 1 with .Item(i) wait window nowait .FullName endwith next endwith