Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CommandBarEvents Interface

Causes a Click event to occur when a control on the command bar is clicked. Use this object for functionality, and refer to CommandBarEventsClass for this object's documentation.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

[GuidAttribute("9E66FE98-A1C6-421D-8C0C-6DA4E652E770")] 
public interface CommandBarEvents : _CommandBarControlEvents, _dispCommandBarControlEvents_Event
/** @attribute GuidAttribute("9E66FE98-A1C6-421D-8C0C-6DA4E652E770") */ 
public interface CommandBarEvents extends _CommandBarControlEvents, _dispCommandBarControlEvents_Event
GuidAttribute("9E66FE98-A1C6-421D-8C0C-6DA4E652E770") 
public interface CommandBarEvents extends _CommandBarControlEvents, _dispCommandBarControlEvents_Event

The CommandBarEvents object is returned by the CommandBarEvents property of the Events object. The object that is returned has one event in its interface, the Click event. In Visual Basic, you can handle this event by using the WithEvents object declaration.

<System.ContextStaticAttribute()> Public WithEvents CommandBarEvents As EnvDTE.CommandBarEvents

Public Sub CommandBarEvents_Click(ByVal CommandBarControl As Object, ByRef handled As Boolean, ByRef CancelDefault As Boolean) Handles CommandBarEvents.Click
   MsgBox("test")
End Sub

Community Additions

ADD
Show:
© 2015 Microsoft