Home » File/Folder Handling » How to Synchronize Drive, Dir And File List Boxes
How to Synchronize Drive, Dir And File List Boxes
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 'File/Folder Handling - How to Synchronize Drive, Dir And File List Boxes Option Explicit 'Add Drive List Box, Dir List Box and File List Box to your Form and add the following code: Dim DriveTemp As Integer Private Sub Dir1_Change() File1.Path = Dir1.Path End Sub Private Sub Drive1_Change() On Error GoTo Drive1_Change_Error Dir1.Path = Drive1.Drive DriveTemp = Drive1.ListIndex On Error GoTo 0 Exit Sub Drive1_Change_Error: Drive1.ListIndex = DriveTemp End Sub Private Sub Form_Load() DriveTemp = Drive1.ListIndex End Sub |
Related posts:
- How to put Drives, Directories And Files In One List Box
- How to Retrieve the File Name from a Path
- How to Open a File and return the File Number
- How to load a text file into list box for a given file name
- How to Close a File for a given File Number
- How to enable the user to drag and drop items between two list boxes
- How to List the all file names of a Zip file
- How to Drag/Move items from one List Box to another List Box
- How to move multiple items from one List Box to another List Box/Combo Box
- How to use Dir$ function to get filenames and display in a list box or something.
Enjoy this article?
Filed under: File/Folder Handling
Leave a comment
Sponsors
Link Back to us
Donations
If you are benefited from this site, please donate a small contribution to us. It will help to maintain this site better.