Link to home
Start Free TrialLog in
Avatar of JackOfPH
JackOfPHFlag for Philippines

asked on

Object reference not set to an instance of an object.

Public Class Form1
    Dim WithEvents Monitor As Timer
    Dim Drives As Dictionary(Of Integer,  System.IO.DriveInfo)

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        For Letters As Int16 = 65 To 90
            Dim mDrives As System.IO.DriveInfo = New System.IO.DriveInfo(Chr(Letters))
            Drives.Add(Letters, mDrives) '--> Getting the error here.
        Next
        Monitor.Start()
    End Sub
end class
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JackOfPH

ASKER

ANgel,

HAHAHA!!!

Silly me!!!

Beginners mistake!!!

Jack