IVsProfferCommands3.AddCommandBar Method

Adds a command bar to the user interface.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'宣言
Function AddCommandBar ( _
    pszCmdBarName As String, _
    dwType As UInteger, _
    pCmdBarParent As Object, _
    dwIndex As UInteger, _
    <OutAttribute> ByRef ppCmdBar As Object _
) As Integer
'使用
Dim instance As IVsProfferCommands3
Dim pszCmdBarName As String
Dim dwType As UInteger
Dim pCmdBarParent As Object
Dim dwIndex As UInteger
Dim ppCmdBar As Object
Dim returnValue As Integer

returnValue = instance.AddCommandBar(pszCmdBarName, _
    dwType, pCmdBarParent, dwIndex, ppCmdBar)
int AddCommandBar(
    string pszCmdBarName,
    uint dwType,
    Object pCmdBarParent,
    uint dwIndex,
    out Object ppCmdBar
)
int AddCommandBar(
    [InAttribute] String^ pszCmdBarName, 
    [InAttribute] unsigned int dwType, 
    [InAttribute] Object^ pCmdBarParent, 
    [InAttribute] unsigned int dwIndex, 
    [OutAttribute] Object^% ppCmdBar
)
function AddCommandBar(
    pszCmdBarName : String, 
    dwType : uint, 
    pCmdBarParent : Object, 
    dwIndex : uint, 
    ppCmdBar : Object
) : int

Parameters

  • pszCmdBarName
    Type: System.String

    [in] Pointer to a string containing the name of the command bar.

  • dwType
    Type: System.UInt32

    [in] Integer. A value from the vsCommandBarType enumeration.

  • pCmdBarParent
    Type: System.Object

    [in] Pointer to the IDispatch interface of the parent of the command bar. Use a null reference (Nothing in Visual Basic) for a top-level command bar.

  • dwIndex
    Type: System.UInt32

    [in] Integer. Location (index) in which to insert the new command bar on the parent.

Return Value

Type: System.Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Permissions

See Also

Reference

IVsProfferCommands3 Interface

IVsProfferCommands3 Members

Microsoft.VisualStudio.Shell.Interop Namespace