Adds a control to a command bar.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
Syntax
'宣言
Function AddCommandBarControl ( _
pszCmdNameCanonical As String, _
pCmdBarParent As Object, _
dwIndex As UInteger, _
dwCmdType As UInteger, _
<OutAttribute> ByRef ppCmdBarCtrl As Object _
) As Integer
'使用
Dim instance As IVsProfferCommands3
Dim pszCmdNameCanonical As String
Dim pCmdBarParent As Object
Dim dwIndex As UInteger
Dim dwCmdType As UInteger
Dim ppCmdBarCtrl As Object
Dim returnValue As Integer
returnValue = instance.AddCommandBarControl(pszCmdNameCanonical, _
pCmdBarParent, dwIndex, dwCmdType, _
ppCmdBarCtrl)
int AddCommandBarControl(
string pszCmdNameCanonical,
Object pCmdBarParent,
uint dwIndex,
uint dwCmdType,
out Object ppCmdBarCtrl
)
int AddCommandBarControl(
[InAttribute] String^ pszCmdNameCanonical,
[InAttribute] Object^ pCmdBarParent,
[InAttribute] unsigned int dwIndex,
[InAttribute] unsigned int dwCmdType,
[OutAttribute] Object^% ppCmdBarCtrl
)
function AddCommandBarControl(
pszCmdNameCanonical : String,
pCmdBarParent : Object,
dwIndex : uint,
dwCmdType : uint,
ppCmdBarCtrl : Object
) : int
Parameters
pszCmdNameCanonical
Type: System.String[in] Pointer to a string containing the fully qualified (canonical) name of the control to add.
pCmdBarParent
Type: System.Object[in] Pointer to the IDispatch interface of the parent command bar.
dwIndex
Type: System.UInt32[in] Integer. The index of the position to place the control.
dwCmdType
Type: System.UInt32[in] Integer. A value from the vsCommandBarType enumeration.
ppCmdBarCtrl
Type: System.Object%[out] Pointer to the IDispatch interface of the newly added control.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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.