Interop Forms Toolkit
How To Create an Interop User Control

An Interop UserControl is created in Visual Studio .NET by opening a new project that uses the Visual Basic 6.0 Interop UserControl template. The resulting project looks and behaves like a Windows Control project, except that the resulting control class contains code that allows the control to be consumed in Visual Basic 6.0. An additional module, ActiveXControlHelpers.vb, contains additional functions that help provide interoperability.

 

To create an Interop UserControl project

  1. Open Visual Studio .NET.
  2. On the File menu, click New Project.
  3. In the New Project dialog box, select the Visual Basic node under Project types, and then select the Visual Basic 6.0 Interop UserControl template under My Templates.
  4. Enter a name for the project and click OK.

 

Additional Interop UserControls can be added to an existing project to provide a control library by using the Visual Basic 6.0 Interop UserControl item template. In this case, only the control template is added to the project; the ActiveXControlHelpers.vb module is shared between the controls.

Note that the Interop UserControl item template is only available in Interop UserControl projects; it cannot be used in other project types.

 

To add another Interop UserControl

  1. In your Interop UserControl project, on the Project menu click Add New Item.
  2. In the Add New Item dialog box, select the Visual Basic 6.0 Interop UserControl template under MyTemplates.
  3. Enter a name for the control and click OK.

Note: The icon that will be displayed in the Visual Basic 6.0 Toolbox can be customized for each control. For information on how to do this, see the comments in the ActiveXControlHelpers.vb file in the Interop UserControl project.