Y
Yuk Tang
Intellisense doesn't sense it, and I get the squiggly error
"Reference to a non-shared member requires an object reference".
Here's the property I want to expose.
Public Class Commands
Property FileName() As String
Get
....
Set
....
End Property
Public Sub New()
FileName = ""
End Sub
End Class
So Commands is a public class, with a publicly exposed property
FileName that is given a value when Commands is instantiated.
But Commands is inside another class.
Public Class Parser
Public Class Commands
....
End Class
Public Sub New()
Dim aCommands As New Commands
End Sub
End Class
So Parser is another public class, that creates an instance of
Commands when it's instantiated. Intellisense even detects that
Commands is a subclass of Parser. However, it doesn't give me any
options after that, and typing in the code manually gives me the
object reference error.
Here's the code in question.
Dim aParser as new Parser
aParser.Commands.FileName = "HelloWorld.txt"
Please can someone help?
"Reference to a non-shared member requires an object reference".
Here's the property I want to expose.
Public Class Commands
Property FileName() As String
Get
....
Set
....
End Property
Public Sub New()
FileName = ""
End Sub
End Class
So Commands is a public class, with a publicly exposed property
FileName that is given a value when Commands is instantiated.
But Commands is inside another class.
Public Class Parser
Public Class Commands
....
End Class
Public Sub New()
Dim aCommands As New Commands
End Sub
End Class
So Parser is another public class, that creates an instance of
Commands when it's instantiated. Intellisense even detects that
Commands is a subclass of Parser. However, it doesn't give me any
options after that, and typing in the code manually gives me the
object reference error.
Here's the code in question.
Dim aParser as new Parser
aParser.Commands.FileName = "HelloWorld.txt"
Please can someone help?