Visual Basic Code of the Week (COTW)
http://www.codeoftheweek.com
Issue #116
Online Version at http://www.codeoftheweek.com/membersonly/bi/0116.html (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 http://www.codeoftheweek.com/futureofasp.html

Earn REAL money surfing the web!

If you would like to make some extra cash for surfing the web, jump to http://www.codeoftheweek.com/paidsurf.html

Requirements

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 questions@codeoftheweek.com

ucDriveInfo

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 - http://www.codeoftheweek.com/issues/0051.html

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 http://www.codeoftheweek.com/issues/issue116

Properties

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).

Methods

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 http://www.codeoftheweek.com/issues/issue116 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: http://www.codeoftheweek.com/membersonly/bi/0116.html


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 http://www.codeoftheweek.com/paidsurf.html

Other links

Contact Information

C&D Programming Corp.
PO Box 20128
Floral Park, NY 11002-0128
Phone or Fax: (212) 504-7945
Email: info@codeoftheweek.com
Web: http://www.codeoftheweek.com