_CommandBars::Add Method (Object^, Object^, Object^, Object^)

 

Adds a command bar.

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

[DispIdAttribute(1610809346)]
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.

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.

Return to top
Show: