Events2::CommandBarEvents Property (Object^)
Gets an object providing events fired when the supplied CommandBarControl object is clicked.
Assembly: EnvDTE80 (in EnvDTE80.dll)
property Object^ default[ Object^ CommandBarControl ] { Object^ get(Object^ CommandBarControl); }
Parameters
- CommandBarControl
-
Type:
System::Object^
Required. The CommandBar control that causes the event to fire.
Implements
Events::CommandBarEvents[Object^]Use 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.
You 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 you create a control and fail to set the OnAction property to a valid string value, then no event is raised on the event object returned by the CommandBarEvents property.