La vista de árbol de VB6.0 muestra carpetas y archivos
Public Function GetExtName(strFileName As String) As String
Dim strTmp As String
Dim strByte como cadena
Dim i As Long
For i = Len(strFileName) To 1 Step -1
strByte = Mid(strFileName, i, 1)
Si strByte lt;gt; "."Entonces
strTmp = strByte strTmp
De lo contrario
Salir para
Finalizar si
Siguiente i
GetExtName = strTmp
Finalizar función
Búsqueda de función pública (ByVal strPath como cadena, como booleano
Dim strFile As String
Dim i As Long
Dim lDirCount As Long
En caso de error, Ir a MyErr
Si Right(strPath, 1) lt;gt; "\" Entonces strPath = strPath "\"
Tv1.strPath, ImageCollapse, ImageExpand
strFile = Dir(strPath, vbDirectory O vbHidden O vbNormal O vbReadOnly)
While strFile lt;gt;""
DoEvents
If (GetAttr(strPath strFile) And vbDirectory) lt ;gt ; vbDirectory entonces
Si LCase(GetExtName(strPath strFile)) = LCase(GetExtName(strSearch)) entonces
Tv1.Nodes.Add strPath, strFile y vbDirectory entonces
p>Tv1.Nodes.Agregar strPath, strFile y vbDirectoryNodes.Agregar strPath, tvwChild, strPath strFile, strFile, ImageCollapse, ImageExpand
End If
Tv1.p>
Finalizar si
Finalizar si
strFile = Dir
Wend
buscar = True
Salir de la Función
MyErr:
buscar = False
Finalizar la Función
Pr
ivate Sub Form_Load()
Tv1.Style = 7
Busque "D:\Documentos\Nueva Carpeta1", ".xls"
Busque " D: \Documentos\Nueva carpeta2", ".xls"
End Sub