Using a New Class in an Application

Of course, a new custom class does no good if you do not use it in an application. To use your new class in an application, you must create a reference from the project in which you want to use the class to the project that contains the class. We’ll illustrate this point by adding a new test project to our sample class project.


When you created the Class Library project earlier in this chapter, Visual Basic .NET automatically created a solution to contain that project. Simply put, a solution is a container for the projects that together comprise an application. Notice that the Solution Explorer window contains a solution named MyClasses, which was created as a container for (and named for) the ...

Get Special Edition Using Microsoft® Visual Basic® .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.