Share via


IVsButtonBarManager.AddButtonBar Method

Adds a set of combo buttons to a code window.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'Declaration
Function AddButtonBar ( _
    cButtons As Integer, _
    hImageList As IntPtr, _
    pClient As IVsButtonBarClient _
) As Integer
int AddButtonBar(
    int cButtons,
    IntPtr hImageList,
    IVsButtonBarClient pClient
)
int AddButtonBar(
    [InAttribute] int cButtons, 
    [InAttribute] IntPtr hImageList, 
    [InAttribute] IVsButtonBarClient^ pClient
)
abstract AddButtonBar : 
        cButtons:int * 
        hImageList:IntPtr * 
        pClient:IVsButtonBarClient -> int
function AddButtonBar(
    cButtons : int, 
    hImageList : IntPtr, 
    pClient : IVsButtonBarClient
) : int

Parameters

  • cButtons
    Type: System.Int32

    [in] The number of buttons in the button bar.

  • hImageList
    Type: System.IntPtr

    [in] Actually an HIMAGELIST, the list of images of buttons in the button bar.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsButtonBarManager::AddButtonBar(
   [in] long cButtons,
   [in] HANDLE hImageList,
   [in] IVsButtonBarClient *pClient
);

AddButtonBar adds a set of combo buttons to a code window. This call wraps the call to Attach. If there is already a button bar attached to the code window AddButtonBar returns E_UNEXPECTED. In general you should call GetButtonBar before calling AddButtonBar to ensure there isn't already a button bar associated with the given code window.

.NET Framework Security

See Also

Reference

IVsButtonBarManager Interface

Microsoft.VisualStudio.TextManager.Interop Namespace