Visual Basic Concepts
Adding Properties and Methods to Classes
The default interface of a class in your component is simply the set of all public properties, methods, and events in the class module, UserControl, or UserDocument that defines the class.
Adding properties and methods is easy — a method is any Public Sub or Public Function procedure you declare in the module that defines your class; a property is any public property procedure or public variable you declare.
The following related topics examine the issues you should be aware of when declaring interface elements in a component.
Implementing Properties in Components Factors to be aware of when creating properties for classes provided by components.
Implementing Methods in Components Factors to be aware of when creating methods for classes provided by components.
Data Types Allowed in Properties and Methods The interface for a class provided by a component follows more strict rules than those required for private objects; at stake is the stability of client programs.
Choosing a Default Property or Method for a Class You can select either a property or a method as the default member for a class.
Important The following names cannot be used as property or method names, because they belong to the underlying IUnknown and IDispatch interfaces: QueryInterface, AddRef, Release, GetTypeInfoCount, GetTypeInfo, GetIDsOfNames, and Invoke. These names will cause a compilation error.
For More Information* The mechanics of property and method declaration are discussed in "Adding Properties to a Class" and "Adding Methods to a Class," in "Programming with Objects," in the *Visual Basic Programmer’s Guide.