
402 Chapter 8 • Windows Forms Components and Controls
Adding a Property to the Class
Now we will add a single property to our CFirst class.The shared property
intClassInstanceCount holds the number of CFirst objects in memory.
To create a property for the CFirst class, add the following property declara-
tion to the CFirst class:
Public Shared ReadOnly Property InstanceCount() As Integer
Get
Return intClassInstanceCount
End Get
End Property
Testing the Component
To test our CFirst component, we need to create a client project that uses the
component. In order to do this, we need to set the client project as the startup
project to ensure it will be the first ...