Export (0) Print
Expand All

Package.ToolboxInitialized Event

Event generated whenever Visual Studio initializes its Toolbox.

This event is not CLS-compliant.  

Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell (in microsoft.visualstudio.shell.dll)

protected event EventHandler ToolboxInitialized
/** @event */
protected void add_ToolboxInitialized (EventHandler value)

/** @event */
protected void remove_ToolboxInitialized (EventHandler value)

JScript supports the use of events, but not the declaration of new ones.

The Visual Studio IDE generates a ToolboxInitialized event whenever one or more of the following situations occur:

  1. A user manually resets the Toolbox by right-clicking on one of the Toolbox categories and selection Reset Toolbox.

  2. A new VSPackage providing Toolbox items is registered.

  3. A VSPackage programmatically generates a ToolboxInitialized event through the Visual Studio SDK by a VSPackage calling ResetDefaults with PKGRF_TOOLBOXITEMS.

                IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
                IVsPackage pkg = GetService(typeof(Package)) as IVsPackage;
                pkg.ResetDefaults((uint)__VSPKGRESETFLAGS.PKGRF_TOOLBOXITEMS);
    

For more information on handling a ToolboxInitialized event and providing custom Toolbox items, see How to: Provide Custom Toolbox Items Using the Managed Package Framework.

Community Additions

ADD
Show:
© 2014 Microsoft