Visual Basic Code of the Week (COTW)
Issue #116
Online Version at (paid subscribers only)
All content and source code is Copyright (c) 2000 by C&D Programming Corp. No part of this issue can be reprinted or distributed in any manner without express written permission of C&D Programming Corp.

Issue topic: Dynamic control techniques/Available Disk Space

Future of ASP

The Future of ASP to be Revealed at ASP Connections. Mark Anders from the Microsoft ASP Team will present to ASP Connections conference attendees a keynote talk entitled ""The Future of ASP"". In this special, exclusive presentation by the creators of ASP, Microsoft will present a comprehensive roadmap of the advances it is making in its ASP technology including server-side UI controls, improved state services, and richer language support. ASP Connections will be held April 30 through May 4, 2000 in Phoenix, Arizona. If you are interested visit our site at

Earn REAL money surfing the web!

If you would like to make some extra cash for surfing the web, jump to


In this Issue

In this issue we discuss a couple of topics. Primarily this issue discusses custom controls and dynamic control creation.

If you have any questions about using this module, let us know at


This issue is more of an application itself than a single module. It is designed to show the available disk space of all connected drives. It will automatically update as you map and unmap network drives. It shows the free space in text and graphical form. The available disk space is determined using the logic found in issue #51 -

Some of the more interesting techniques shown in this issue are how to create controls on the fly in VB 5 and up (some new features were introduced in VB 6 to make this even easier). Each drive is represented by a ucDriveInfo user control. The code within the main form calls the Refresh method as often as necessary.

The complete source code (project and all) is available at


Public Property Let DriveLetter(sDrive As String)

Allows you to assign which drive letter this control is going to watch. sDrive only needs to contain a single letter from A to Z. It will handle drives passed as x: (where you specify the : after the drive letter).


Public Sub Refresh()

Refreshes the information about the drive specified by DriveLetter.

Sample Usage

This issue is an application itself so there is no sample to show.

See for the complete source code.

Source Code

To see the source code for this issue you must be a subscriber to Code of the Week. If you are a subscriber the source code is available at the following address:

This document is available on the web

Paid subscribers can view this issue in HTML format. There is no additional source or information in the HTML formatted document. It just looks a little better since we have included some HTML formatting. Just point your browser to link at the top of this document.

Get paid to surf the web!

If you would like to get paid for surfing the web, jump to

Other links

Contact Information

C&D Programming Corp.
PO Box 20128
Floral Park, NY 11002-0128
Phone or Fax: (212) 504-7945