Share via


DTE2.CommandBars Property

Definition

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

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

Property Value

A Microsoft.VisualStudio.CommandBars object.

Implements

Attributes

Examples

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

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.

Applies to