0 out of 3 rated this helpful - Rate this topic

DTE2.CommandBars Property 

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

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

Object CommandBars { get; }
/** @property */
Object get_CommandBars ()

function get CommandBars () : Object

Property Value

A Microsoft.VisualStudio.CommandBars object.

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.

Sub CommandBarsExample()
  MsgBox(DTE2.CommandBars.Count)
End Sub
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.