I usually put a drive box, directory box, and a fliebox.
Normally ineterlink them via there paths. In the change event between the directory box and the filebox put File1.Path=Dir1.Path.
Conceptually, what you're wanting to do is make the directory control sensitive to a change the user makes in the drive control. Here's how I do it...
Private Sub Drive1_Change()
'Hand off the selected drive to the directories control...
Dir1.Path = Drive1.Drive
Me.Refresh
lstFiles.Path = Dir1.Path
Me.Refresh
End Sub
Private Sub Dir1_Change()
'Force a change in the directories control to cascade down
'to the files list...
lstFiles.Path = Dir1.Path
Me.Refresh
End Sub
The Me.Refresh is very important here as otherwise the change in the control's data will occur, but the user interface would not update.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.