Compartilhar via


Creating Toolbar Buttons for Add-in Commands Programmatically (Windows CE 5.0)

Send Feedback

If you work with a previously created add-in, you may want to add new toolbar button for your commands.

To add the code for a button

  1. Open the project for the add-in.

  2. In ClassView, expand the project's classes, and then expand the CPBAddIn class.

  3. Double-click the IDSAddIn::OnConnection method.

  4. Search for the code that adds the appropriate command. This code calls the IApplication::AddCommand method.

  5. After the AddCommand call, call the IApplication::AddCommandBarButton method if the bFirstTime parameter of the OnConnection method has a value of VARIANT_TRUE.

    This parameter directs Visual Studio to call AddCommandBarButton only when the user first connects the add-in to Visual Studio.

See Also

Creating Toolbar Buttons for Add-in Commands Visually

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.