See Also Example
Applies To
File list box.
Description
Occurs when the path
Syntax
Sub ctlname_PathChange ([Index As Integer])
Remarks
The argument Index uniquely identifies a control if it is in a control array. You can use a PathChange procedure to respond to path changes in a file list box. When you assign a string containing a new path to the FileName property, the file list box control invokes the PathChange event.
Help:
FileName Property
Path Property
Pattern Property
PatternChange Event
Programmer's Guide:
Chapter 18, "Using the File-System Controls"
The example demonstrates how to update a label control to reflect the current path for a file list box. Double-clicking a directory name displays a list of that directory's files in the file list box; 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, a directory list box and a file list box. Then press F5.
Sub File1_PathChange ()
Label1.Caption = "Path: " & Dir1.Path ' Show path in label.
End Sub
Sub Dir1_Change ()
File1.Path = Dir1.Path ' Set file path.
End Sub
Sub Form_Load ()
Label1.Caption = "Path: " & Dir1.Path ' Show path in label.
End Sub