December 2001
Intermediate to advanced
360 pages
9h 6m
English
Create a new VB .NET Windows Application project and name it InheritanceTest. Add a button to the form and go to the code window. In the code, add the following class. Make sure that you add it outside the class for the form!
Public Class Person
Dim msName, msAddress As String
Property Name() As String
Get
Name = msName
End Get
Set(ByVal Value As String)
msName = Value
End Set
End Property
Property Address() As String
Get
Address = msAddress
End Get
Set(ByVal Value As String)
msAddress = Value
End Set
End Property
Public Function Enroll() As Boolean
'check class enrollment
'if enrollment < max. class size then
'enroll person in class
Enroll = True
End Function
End Class
This code creates a Person class with two properties, ...