Returns or sets the selected drive at run time. Not available at design time.
Syntax
object.Drive [= drive]
The Drive property syntax has these parts:
Part | Description |
Object | An object expression that evaluates to an object in the Applies To list. |
Drive | A string expression that specifies the selected drive. |
Remarks
The valid drives for the Drive property include all drives present in or connected to the system when the control is created or refreshed at run time. The default setting of the Drive property is the current drive.
When reading this property setting, the selected drive is returned in one of the following formats:
When setting this property:
If the FileName property is set to a qualified network path without a drive designation, the value of the Drive property is a zero-length string (""), no drive is selected, and the ListIndex property setting is –1.
Note The Drive property returns a different value from the ListIndex property, which returns the list box selection.