ucDriveCombo v1.2 - Modern DriveList Replacement
Updated 22 Apr 2024
While my ucShellBrowse control is capable of displaying a drive list like this, it's really overkill if that's all you need. I thought VB6 and twinBASIC could use a simple but modernized replacement of just the DriveList control. This project is supplied as a VB6 .ctl that has code which runs unmodified in twinBASIC, with 64bit support. Project files for both are provided. For VB6, you must include mUCDCHelper.bas in your projects. In twinBASIC, this module is combined in the same .twin file as the control.
**No typelib or package dependency!** Just need the .ctl/.ctx/.bas for VB6 or the .tbcontrol/.twin for twinBASIC; doesn't require oleexp, WinDevLib, or any similar dependencies.
Full readme:
Code:
'********************************************************************
' ucDriveCombo v1.2
' A Modern DriveList Replacement
' by Jon Johnson
'
' Provides a modernized option for a Drive Combo without the extra
' complexity of a full blown ucShellBrowse control.
'
' Requirements: VB6 or twinBASIC Beta 515
' Note: This file combines the mUCDCHelper module; in VB6 that
' must be in its own .bas.
'
' Features:
' -Same codebase for VB6 and twinBASIC
' -64bit compatible
' -Filter drives shown by type
' -Uses same friendly name and icon as Explorer
' -Monitors for drive add/remove (optional)
' -Supports both dropdown list and standard dropdown styles
' -Drive selection can be get/set by path, letter, or name.
' -SelectionChanged event
' -Can provide list of drives
' -Can optionally classify USB hard drives as removable.
'
' Changelog:
' Version 1.2 (Released 22 Apr 2024)
' -Add Drive property get/let for compatibility with DriveList;
' it behaves identically to .SelectDriveName.
' -DriveCount is now ListCount, for DriveList compat. Also added
' .ListIndex for selected index, and .List, same as GetDriveName.
' -Add Enabled property get/let.
' -(Bug fix) FocusDriveList VB6 syntax error
' -(Bug fix) VB6 control bottom cut off
'
' Version 1.1 (Released 22 Apr 2024)
' -Autosize UC height to combo height
' -Custom drop width now DPI aware
' -FocusDriveList method to hopefully partially defray the lack of
' a massive and usually typelib dependent in-place activation
' hook to handle tab properly. Recommend ucShellBrowse if you
' need proper tab key support.
' -(Bug fix) DPI variable overridden by old test line.
' -(Bug fix) VB6 control bottom cut off
'
' Version 1.0 (Released 22 Apr 2024)
' -Add Property Lets for SelectedDrive_____
' -Add device add/remove monitoring via RegisterDeviceNotification
' -Add DPI aware support
' -Add DropdownWidth option
'
' Version Beta 1 - Initial release (Released 21 Apr 2024)
'********************************************************************