O'Reilly logo

Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition by Harvey M. Deitel - Deitel & Associates, Inc., Paul J. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.2. Time Class Case Study

We begin with a substantial application that uses most of the object-oriented programming concepts presented in Chapters 4 through 8. We introduce the Object class, the ultimate “ancestor” of all classes in Visual Basic. Also, we explain method ToString, which can be used to obtain a String representation of any Visual Basic object.

Time Class Declaration

The application consists of classes Time (Fig. 9.1) and FrmTimeTest (Fig. 9.2). Class Time contains the information needed to represent a specific time in two popular formats. Class FrmTimeTest represents a GUI for class Time.

Figure 9.1. Time class declaration maintains the time in 24-hour format.
						1
						' Fig. 9.1: Time.vb
						2
						' Represents time to clients in 12-hour and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required