共用方式為


_CommandBars.Add Method

Adds a command bar.

Namespace:  Microsoft.VisualStudio.CommandBars
Assembly:  Microsoft.VisualStudio.CommandBars (in Microsoft.VisualStudio.CommandBars.dll)

Syntax

'宣告
Function Add ( _
    Name As Object, _
    Position As Object, _
    MenuBar As Object, _
    Temporary As Object _
) As CommandBar
CommandBar Add(
    Object Name,
    Object Position,
    Object MenuBar,
    Object Temporary
)

Parameters

  • Name
    Type: System.Object
    [in, optional] The name of the command bar. If this parameter is not specified, a unique name is generated.
  • Position
    Type: System.Object
    [in, optional] The MsoBarPosition of the new command bar. If this parameter is not specified the default value is msoBarFloating.
  • MenuBar
    Type: System.Object
    [in, optional] Whether the new bar is a menu or not.  Visual Studio does not support adding menus with this method; the value must be false.
  • Temporary
    Type: System.Object
    [in, optional] Whether the new control will be present in future sessions of Visual Studio. If this parameter is not specified, the default value is false.

Return Value

Type: Microsoft.VisualStudio.CommandBars.CommandBar
The newly-added CommandBar.

Remarks

The command bar that is added by using this method is a temporary command bar, which appears only when the add-in is loaded.

For more information about adding and removing permanent and temporary command bars, see HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from an add-in and HOWTO: Removing commands and UI elements during Visual Studio .NET add-in uninstallation.

.NET Framework Security

See Also

Reference

_CommandBars Interface

Microsoft.VisualStudio.CommandBars Namespace