Freigeben über


IVsButtonBarManager.AddButtonBar(Int32, IntPtr, IVsButtonBarClient) Method

Definition

Adds a set of combo buttons to a code window.

public:
 int AddButtonBar(int cButtons, IntPtr hImageList, Microsoft::VisualStudio::TextManager::Interop::IVsButtonBarClient ^ pClient);
public int AddButtonBar (int cButtons, IntPtr hImageList, Microsoft.VisualStudio.TextManager.Interop.IVsButtonBarClient pClient);
abstract member AddButtonBar : int * nativeint * Microsoft.VisualStudio.TextManager.Interop.IVsButtonBarClient -> int
Public Function AddButtonBar (cButtons As Integer, hImageList As IntPtr, pClient As IVsButtonBarClient) As Integer

Parameters

cButtons
Int32

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

hImageList
IntPtr

nativeint

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

pClient
IVsButtonBarClient

[in] The client to be associated with the button bar.

Returns

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.

Applies to