Sdílet prostřednictvím


_CommandBars.Add(Object, Object, Object, Object) Method

Definition

Adds a command bar.

Microsoft::VisualStudio::CommandBars::CommandBar Add(winrt::Windows::Foundation::IInspectable const & Name, winrt::Windows::Foundation::IInspectable const & Position, winrt::Windows::Foundation::IInspectable const & MenuBar, winrt::Windows::Foundation::IInspectable const & Temporary);
[System.Runtime.InteropServices.DispId(1610809346)]
public Microsoft.VisualStudio.CommandBars.CommandBar Add (object Name, object Position, object MenuBar, object Temporary);
public Microsoft.VisualStudio.CommandBars.CommandBar Add (object Name, object Position, object MenuBar, object Temporary);
[<System.Runtime.InteropServices.DispId(1610809346)>]
abstract member Add : obj * obj * obj * obj -> Microsoft.VisualStudio.CommandBars.CommandBar
abstract member Add : obj * obj * obj * obj -> Microsoft.VisualStudio.CommandBars.CommandBar
Public Function Add (Optional Name As Object, Optional Position As Object, Optional MenuBar As Object, Optional Temporary As Object) As CommandBar

Parameters

Name
Object

[in, optional] The name of the command bar. If this parameter is not specified, a unique name is generated.

Position
Object

[in, optional] The MsoBarPosition of the new command bar. If this parameter is not specified the default value is msoBarFloating.

MenuBar
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
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.

Returns

The newly-added CommandBar.

Attributes

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.

Applies to