Gets an object providing events fired when the supplied CommandBarControl object is clicked.
Assembly: EnvDTE (in EnvDTE.dll)
The property is used by an Add-in 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 property is called, and 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 some valid string value, then no event is raised on the event object returned by the property.
- 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.