Events2.CommandBarEvents Property
Gets an object providing events fired when the supplied CommandBarControl object is clicked.
Namespace: EnvDTE80
Assembly: EnvDTE80 (in EnvDTE80.dll)
Syntax
'Declaration
ReadOnly Property CommandBarEvents ( _
CommandBarControl As Object _
) As Object
Object this[
Object CommandBarControl
] { get; }
property Object^ CommandBarEvents[[InAttribute] Object^ CommandBarControl] {
Object^ get ([InAttribute] Object^ CommandBarControl);
}
abstract CommandBarEvents : Object
JScript does not support indexed properties.
Parameters
- CommandBarControl
Type: System.Object
Required. The CommandBar control that causes the event to fire.
Property Value
Type: System.Object
A CommandBarEvents object.
Implements
Events.CommandBarEvents[Object]
Remarks
An Add-in uses the CommandBarEvents property to connect an event with a click of a Microsoft.VisualStudio.CommandBars.CommandBarControl object, or to connect to the Click event of any member of the Microsoft.VisualStudio.CommandBars.CommandBarControls collection.
The Add-in must set the OnAction property to some string value. It can set this value after the CommandBarEvents property is called, and it can reset it to a blank string, which disconnects the event. If an Add-in creates a control and fails to set the OnAction property to a valid string value, then no event is raised on the event object returned by the CommandBarEvents property.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.