Unhandled Exception Error

G

Guest

I am using vb.net (VS 2003) on an XP and get the following error message:
An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.

on the following sub (The line with ***)

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

All I am trying to do is to close a form using the following code:

LVLabelApp.LblApp.Quit()
LVLabelApp.LblApp = Nothing
Me.Close()


Please help?????????
 
H

Herfried K. Wagner [MVP]

Shariq said:
I am using vb.net (VS 2003) on an XP and get the following error message:
An unhandled exception of type 'System.NullReferenceException' occurred
in
system.windows.forms.dll
Additional information: Object reference not set to an instance of an
object.

on the following sub (The line with ***)

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

Where's the line that is marked with "***"?
 
G

Guest

Sorry, I forgot to add the *** to the line that errored out.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
*** MyBase.Dispose(disposing)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top