This example demonstrates how to update a Label control to reflect the current path for a FileListBox control. Double-clicking a directory name displays a list of that directory's files in the FileListBox; it also displays the directory's complete path in the Label control. To try this example, paste the code into the Declarations section of a form that contains a Label control, a DirListBox control, and a FileListBox control, and then press F5. Double-click a directory to change the path.
Private Sub File1_PathChange ()
Label1.Caption = "Path: " & Dir1.Path ' Show path in Label.
End Sub
Private Sub Dir1_Change ()
File1.Path = Dir1.Path ' Set file path.
End Sub
Private Sub Form_Load ()
Label1.Caption = "Path: " & Dir1.Path ' Show path in Label.
End Sub