Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

Chapter 16 Inheriting Forms and Creating Base Classes 413


To Do This
Set properties for an
object variable

Use the regular syntax for setting object properties. For example:
Employee.FirstName = TextBox1.Text
Inherit a base class
in a new class

Create a new class, and use the Inherits keyword to incorporate the base
class’s class definitions. For example:
Public Class Teacher
Inherits Person
Private Level As Short

Public Property Grade() As Short
Get
Return Level
End Get
Set(ByVal value As Short)
Level = value
End Set
End Property
End Class
Free download pdf