Поделиться через


CommandBarControls.Add Method

Adds a command bar control with the given characteristics.

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

Syntax

'Declaration
Function Add ( _
    Type As Object, _
    Id As Object, _
    Parameter As Object, _
    Before As Object, _
    Temporary As Object _
) As CommandBarControl
CommandBarControl Add(
    Object Type,
    Object Id,
    Object Parameter,
    Object Before,
    Object Temporary
)
CommandBarControl^ Add(
    [InAttribute] Object^ Type, 
    [InAttribute] Object^ Id, 
    [InAttribute] Object^ Parameter, 
    [InAttribute] Object^ Before, 
    [InAttribute] Object^ Temporary
)
abstract Add : 
        Type:Object * 
        Id:Object * 
        Parameter:Object * 
        Before:Object * 
        Temporary:Object -> CommandBarControl 
function Add(
    Type : Object, 
    Id : Object, 
    Parameter : Object, 
    Before : Object, 
    Temporary : Object
) : CommandBarControl

Parameters

  • Type
    Type: System.Object
    [in, optional] The MsoControlType of the new control. If this parameter is not specified, the default value is msoControlButton.
  • Id
    Type: System.Object
    [in, optional] An integer representing the control ID. If this parameter is not specified, the default value is 0.
  • Parameter
    Type: System.Object
    [in, optional] A string representing the parameter of the new control. If this parameter is not specified, the default value is the empty string.
  • Before
    Type: System.Object
    [in, optional] An integer representing the index of the new control. If this parameter is not specified, the new control is added at the end of the collection.
  • Temporary
    Type: System.Object
    [in, optional] A Boolean indicating whether the new control will be present in future sessions of Visual Studio. Controls added with this method never persist beyond the current session, regardless of the setting of this parameter.

Return Value

Type: Microsoft.VisualStudio.CommandBars.CommandBarControl
The T[:Microsoft.VisualStudio.CommandBars.CommandBarControl].

.NET Framework Security

See Also

Reference

CommandBarControls Interface

Microsoft.VisualStudio.CommandBars Namespace