VB: DIRECTORY LISTING

a program created in MS Visual Basic 6.0 for directory browsing

Drive Listbox (name: Drive1) - list of drives
DirListBox (name: Dir1) - list of drives / folders
TextBox (name: txtpattern, Text: *.*) - enter a file extension
FileListBox (name: File1) - list of files in a folder

code:

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive ' Set directory path.
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path ' Set file path.
lblpath.Caption = File1.Path
lblnum.Caption = "Total number of files:" & " " & File1.ListCount & " " & "(" & txtpattern.Text & ")"
End Sub

Private Sub File1_Click()
lblname.Caption = File1.Path & "\" & File1.FileName
End Sub

_________________________________________________________________
  .  cdo bloggers   .  my digital corner   .  sacha chua   .  the oatmeal   .  toxel.com   . 
  .  Hotels & Resorts Worldwide   .