by Per Janssen (3 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 24th February 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This little code, checks for free diskdrive's and add them to a combobox
Private Sub Form_Load()
Call FreeDrive
End Sub
Private Sub FreeDrive()
On Error GoTo errHandler
Dim intDriveLetter As Integer
Dim strFreeDrive As String
Dim intCounter As Integer
Dim intFocus As Integer
intDriveLetter = 67 'Start with Drive C:
Do Until intDriveLetter = 92
ChDir Chr(intDriveLetter) & ":"
strFreeDrive = Chr(intDriveLetter) & ":"
intDriveLetter = intDriveLetter + 1
Loop
cmbFreeDrive.ListIndex = intCounter - 1
errHandler:
Select Case Err.Number
Case 75
Resume Next
Case 76
cmbFreeDrive.AddItem strFreeDrive
intCounter = intCounter + 1
Resume Next
Case Else
End Select
End Sub
No comments have been posted about This little code, checks for free diskdrive's and add them to a combobox. Why not be the first to post a comment about This little code, checks for free diskdrive's and add them to a combobox.