This documentation is archived and is not being maintained.

Adding ActiveX Controls to Windows Forms

Visual Studio .NET 2003

While the Windows Forms Designer is optimized to host Windows Forms controls, you can also put ActiveX controls on Windows Forms.

Caution   There are performance limitations for Windows Forms when ActiveX controls are added to them.

Before you add ActiveX controls to your form, you must add them to the Toolbox. For more information, see COM Components, Customize Toolbox Dialog Box.

To add an ActiveX control to your Windows Form

  • Double-click the control on the Toolbox.

    Visual Studio adds all references to the control in your project. For more information on things to keep in mind when using ActiveX controls on Windows Forms, see Considerations When Hosting an ActiveX Control on a Windows Form.

    Note   The Windows Forms ActiveX Control Importer (AxImp.exe) creates event arguments of a different type than expected upon importation of ActiveX dynamic link libraries. The arguments created by AxImp.exe are similar to the following:
    Invoke(object sender, DWebBrowserEvents2_ProgressChangeEvent e)
    , when
    Invoke(object sender, DWebBrowserEvents2_ProgressChangeEventArgs e)
    is expected. Be aware that this irregularity does not prevent code from functioning normally. For details, see Windows Forms ActiveX Control Importer (Aximp.exe).

See Also

Windows Forms Controls | Controls by Category | ActiveX Controls by Function | Controls and Programmable Objects Compared in Different Languages and Libraries | Adding Controls to Windows Forms | Arranging Controls on Windows Forms | Labeling Individual Windows Forms Controls and Providing Shortcuts to Them | Controls You Can Use on Windows Forms | Windows Forms Controls by Function