m.r.m.40 wrote:
when I try to assign value to its variables I fail
That's becuase of variable visibility/scope. Please, read this:
Variable and Method Scope in Microsoft .NET[
^]
Scope in Visual Basic[
^]
You have declared
_menuName
as private member, which means that variable is visible only inside your class.
Private _menuName As String
If you want to access to it, you have to change its visibility to public or you have to define method/property. You've chosen a property, but its setter is trying to access to variable you've declared in class constructor! Please, see the
Gegniani[
^]'s answer.
Another issue i have found inside class constructor:
Public Sub New(newMenuName As String,
newEntranceDateTime As DateTime)
_menuName = newMenuName
_formEntrance = newEntranceDateTime
End Sub
You should avoid setting a property inside class constructor. Instead of it, use internal variables.
Please, read this:
Constructor Design[
^]
Object-Oriented Programming in Visual Basic .NET[
^]