DTE2.CommandBars Property

Gets a reference to the development environment's CommandBars object.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Syntax

'Declaration
ReadOnly Property CommandBars As Object
Object CommandBars { get; }
property Object^ CommandBars {
    Object^ get ();
}
abstract CommandBars : Object
function get CommandBars () : Object

Property Value

Type: System.Object
A Microsoft.VisualStudio.CommandBars object.

Implements

_DTE.CommandBars

Remarks

The CommandBars object is a part of Microsoft.VisualStudio.Commandbars.

In Visual Studio 2005, CommandBars returns an object (actually, an IDispatch) instead of a CommandBars instance as it did in previous versions of Visual Studio. When programming against CommandBars in Visual C#, an exception occurs if the index in DTE2.CommandBars.this[object index] is not found in the CommandBars container.

Examples

Sub CommandBarsExample()
  MsgBox(DTE2.CommandBars.Count)
End Sub

.NET Framework Security

See Also

Reference

DTE2 Interface

EnvDTE80 Namespace