Skip to Content
A Programmer's Introduction to Visual Basic® .NET
book

A Programmer's Introduction to Visual Basic® .NET

by Craig Utley
December 2001
Intermediate to advanced content levelIntermediate to advanced
360 pages
9h 6m
English
Sams
Content preview from A Programmer's Introduction to Visual Basic® .NET

A Quick Inheritance Example

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, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Visual Basic® Programmer's Guide to the .NET Framework Class Library

Visual Basic® Programmer's Guide to the .NET Framework Class Library

Lars Powers, Mike Snell
Application Development Using Visual Basic® and .NET

Application Development Using Visual Basic® and .NET

Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt
Visual Basic® .NET by Example

Visual Basic® .NET by Example

Gabriel Oancea, Bob Donald

Publisher Resources

ISBN: 0672322641Purchase book