Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy!! How do I link File list Boxes to Drive Boxes?? 2

Status
Not open for further replies.

bighavlo

Programmer
Jul 14, 2003
19
0
0
US
I know this is an easy one, I just can't find the answer anywhere. How do I link File list Boxes to the Drive Box the user just picked??
 
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.
 
Thanks much for answering so quickly, I'll check it out and see if I can get it to work. - Thanks - Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top