O'Reilly logo

Developing Microsoft® .NET Controls with Microsoft Visual Basic® .NET by John Connell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building an Advanced Drive Tool Using Intrinsic Controls

Since you already created the OwnerDraw drive combo box in Chapter 2, you can concentrate on just the ListView control here. Add the arrays aDriveType and aMediaType to your form. Although WMI is powerful, some of the values it returns are integers that represent the type of drive or media. You’ll index into the arrays to retrieve and display the name instead of a value of, say, 4, which is fairly meaningless except to the extremely hardcore among us. (Don’t look around; you know who you are.)

Imports System.Management Imports System.Collections Public Class Drives Inherits System.Windows.Forms.Form Dim drive As driveInfo Dim alDrives As New ArrayList() Dim mgtObjectSearcher As System.Management.ManagementObjectSearcher ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required