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
'宣言
Function AddButtonBar ( _
cButtons As Integer, _
hImageList As IntPtr, _
pClient As IVsButtonBarClient _
) As Integer
'使用
Dim instance As IVsButtonBarManager
Dim cButtons As Integer
Dim hImageList As IntPtr
Dim pClient As IVsButtonBarClient
Dim returnValue As Integer
returnValue = instance.AddButtonBar(cButtons, _
hImageList, pClient)
int AddButtonBar(
int cButtons,
IntPtr hImageList,
IVsButtonBarClient pClient
)
int AddButtonBar(
[InAttribute] int cButtons,
[InAttribute] IntPtr hImageList,
[InAttribute] IVsButtonBarClient^ pClient
)
function AddButtonBar(
cButtons : int,
hImageList : IntPtr,
pClient : IVsButtonBarClient
) : int
Parameters
cButtons
Type: System.Int32[in]
hImageList
Type: System.IntPtr[in] actually an HIMAGELIST.
pClient
Type: Microsoft.VisualStudio.TextManager.Interop.IVsButtonBarClient[in]
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.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.