BlakeMcKenna
asked on
Getting the proverbial "Object reference not set to an instance of an object" error?
I've created a class that inherits the System.Windows.Forms.TabPa ge class. I'm not sure how to declare an instance of the class. There needs to be an instance for each TabPage created on a specific TabControl. I basically set this new property in the "SelectedIndexChanged()" Event. I'm getting Object Reference error because I'm not sure how to declare the variable.
New Class
What is the difference in the two statements below?
How should it be declare with regard to the context in which I'm using it. I only set and check this property in the "SelectedIndexChanged()" Event.
Thanks!
New Class
Public Class tabPageViewed
Inherits System.Windows.Forms.TabPage
Private _viewed As Boolean
Property TabViewed() As Boolean
Get
TabViewed = _viewed
End Get
Set(value As Boolean)
_viewed = value
End Set
End Property
End Class
What is the difference in the two statements below?
'Statement 1
Private tabV() As tabPageViewed
'Statement 2
Private tabV As New tabPageViewed()
How should it be declare with regard to the context in which I'm using it. I only set and check this property in the "SelectedIndexChanged()" Event.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How should I declare it with reference to how I'm using it?
See post 40881158!
See post 40881158!
ASKER
Thanks!
ASKER
Open in new window