Condividi tramite


Events.CommandBarEvents[Object] Property

Definition

Gets an object providing events fired when the supplied CommandBarControl object is clicked.

public:
 property System::Object ^ CommandBarEvents[System::Object ^] { System::Object ^ get(System::Object ^ CommandBarControl); };
public:
 property EnvDTE::CommandBarEvents ^ CommandBarEvents[System::Object ^] { EnvDTE::CommandBarEvents ^ get(System::Object ^ CommandBarControl); };
[System.Runtime.InteropServices.DispId(205)]
public object CommandBarEvents[object CommandBarControl] { [System.Runtime.InteropServices.DispId(205)] get; }
[System.Runtime.InteropServices.DispId(205)]
public EnvDTE.CommandBarEvents CommandBarEvents[object CommandBarControl] { [System.Runtime.InteropServices.DispId(205)] get; }
[<System.Runtime.InteropServices.DispId(205)>]
[<get: System.Runtime.InteropServices.DispId(205)>]
member this.CommandBarEvents(obj) : obj
[<System.Runtime.InteropServices.DispId(205)>]
[<get: System.Runtime.InteropServices.DispId(205)>]
member this.CommandBarEvents(obj) : EnvDTE.CommandBarEvents
Public ReadOnly Property CommandBarEvents(CommandBarControl As Object) As Object
Public ReadOnly Property CommandBarEvents(CommandBarControl As Object) As CommandBarEvents

Parameters

CommandBarControl
Object

Required. The CommandBar control that causes the event to fire.

Property Value

A CommandBarEvents object.

Attributes

Remarks

The CommandBarEvents[] property is used 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.

You must set the OnAction property to some string value. You can set this value after the CommandBarEvents[] property is called, and can reset it to a blank string, which disconnects the event. If you create a control without setting the OnAction property to a valid string value, then no event is raised on the event object returned by the CommandBarEvents[] property.

Applies to