VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This little code, checks for free diskdrive's and add them to a combobox

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

Rate 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

Download this snippet    Add to My Saved Code

This little code, checks for free diskdrive's and add them to a combobox Comments

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.

Post your comment

Subject:
Message:
0/1000 characters