Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 39,574 times

Contents

Related Categories

Drive Combo, Folder and File List Controls - Drive ComboBox

Drive ComboBox

The Drive Combo box lists all the available drives on the PC. It's properties are almost identical to a Combo Box, except that it has a Drive property, and no Style property.

To get or set the current drive, use the Drive property:

Drive1.Drive = "C:"

or

Msgbox "The current drive is " & Drive1.Drive

When the current drive has changed, the Change event occurs. Note that when the drive changes, the control does not attempt to access it... so if there is no disk in the drive, it does not matter. (This will not be the case when we use the 3 controls together, and the Folder/Files list boxes attempt to read the disk!)

James first started writing tutorials on Visual Basic in 1999 whilst starting this website (then known as VB Web). Since then, the site has grown rapidly, and James has written numerous tutorials, articles and reviews on VB, PHP, ASP and C#. In October 2003, James formed the company Developer Fusion Ltd, which owns this website, and also offers various development services. In his spare time, he's a 3rd year undergraduate studying Computer Science in the UK. He's also a Visual Basic MVP.

Comments

  • Houston, we have a problem...

    Posted by HyperHacker on 28 Jul 2003

    When I try to set the drive list's drive back to the previous one, it shows me that drive in the dir/file boxes, but the drive selector remains at the drive the user selected. Any way to fix it? (Usin...

  • Thank you VERY much!

    Posted by Knoj on 30 May 2003

    I am a beginner, and I found your article VERY easy to use, and it saved me alot of time on my project! Thank you again, and I have a small possibly un-nessary, but usefull addition to one line of yo...