Team Fly |
Page 194
Before getting into some additional aspects of reflection, try it in some code. You first must instantiate a Reflection. Assembly class and also access an existing assembly. There are several ways to do this (as is usually the case in .NET—you can choose from a variety of coding styles).
Probably the simplest example of reflection is accessing a single type (a class, in this case, and in most cases). Add a TextBox to a new VB.NET Windows style project, change the TextBox's MultiLine property to True, delete its default Text property, add a vertical scrollbar, then type Listing 8.1 in.
LISTING 8.1: A SIMPLE EXAMPLE OF REFLECTION |
Imports System.Reflection |
Team Fly |