Partager via


IVsToolbox2.AddTab2 Method

Adds a tab to the Toolbox, specifying the tab view.

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

Syntax

'Declaration
Function AddTab2 ( _
    lpszTab As String, _
    ByRef guidPkg As Guid _
) As Integer
int AddTab2(
    string lpszTab,
    ref Guid guidPkg
)
int AddTab2(
    [InAttribute] String^ lpszTab, 
    [InAttribute] Guid% guidPkg
)
abstract AddTab2 : 
        lpszTab:string * 
        guidPkg:Guid byref -> int
function AddTab2(
    lpszTab : String, 
    guidPkg : Guid
) : int

Parameters

  • lpszTab
    Type: String

    [in] The localized name of the tab to add to the Toolbox. The localized name can be obtained from the invariant non-localized name by calling GetIDOfTab.

  • guidPkg
    Type: Guid%

    [in] Package GUID identifying your VSPackage.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsToolbox2::AddTab2(
   [in]LPCOLESTR lpszTab,
   [in]REFGUID guidPkg
);

The Toolbox uses the Package GUID to set the UI text for your Toolbox item. In the bstrText element of the TBXITEMINFO Structure, you should specify a resource ID of the form "#number". This resource ID must then correspond to the UI string for the Toolbox item in your satellite DLL. The Toolbox persists the package GUID and resource ID for each Toolbox item. This enables it to reassign each Toolbox UI string in the event that the user changes the environment language (locale).

Note

If you specify the name of a tab that has already been added, then this method returns E_FAIL.

.NET Framework Security

See Also

Reference

IVsToolbox2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace