What's New
Q & A
Tip Jar
C# Helper...
Follow VBHelper on Twitter
MSDN Visual Basic Community
  Tutorial: Introduction to ExtenderProviders in VB .NET  

Introduction to ExtenderProviders

An ExtenderProvider is a VB .NET component that adds a property to other controls. For example, if you add a ToolTip component to a form and click on a TextBox, the Properties window includs a property with a name such as "ToolTip on ToolTip1." The ToolTip component is an ExtenderProvider that provides a ToolTip property.

To build an ExtenderProvider:

  1. Create a new component (select the Project menu's Add Component command).
  2. Use an Implements statement to make the component implement the IExtenderProvider interface.
  3. Write the CanExtend function required by the IExtenderProvider interface. This function takes an object as a parameter and returns True if it can extend that object.
  4. Give the component a ProvideProperty attribute to tell Visual Basic the names of the properties that it will provide.
  5. Build get and set routines for those properties. These routines must have the same names as the properties with the words Get and Set added to the front.
  6. Compile the project.
  7. Install the component in the toolbox.
    • Right-click on the toolbox and select Add/Remove Items.
    • Browse to the directory that contains the executable you just made.
    • Select the executable.
For some examples that include additional features such as toolbox bitmaps and default property values, see these HowTos:


Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.