共用方式為


IVsToolbox.AddItem(IDataObject, TBXITEMINFO[], String) Method

Definition

Adds a data object to the specified tab in the Toolbox.

public:
 int AddItem(Microsoft::VisualStudio::OLE::Interop::IDataObject ^ pDO, cli::array <Microsoft::VisualStudio::Shell::Interop::TBXITEMINFO> ^ ptif, System::String ^ lpszTab);
int AddItem(Microsoft::VisualStudio::OLE::Interop::IDataObject const & pDO, std::Array <Microsoft::VisualStudio::Shell::Interop::TBXITEMINFO> const & ptif, std::wstring const & lpszTab);
public int AddItem (Microsoft.VisualStudio.OLE.Interop.IDataObject pDO, Microsoft.VisualStudio.Shell.Interop.TBXITEMINFO[] ptif, string lpszTab);
abstract member AddItem : Microsoft.VisualStudio.OLE.Interop.IDataObject * Microsoft.VisualStudio.Shell.Interop.TBXITEMINFO[] * string -> int
Public Function AddItem (pDO As IDataObject, ptif As TBXITEMINFO(), lpszTab As String) As Integer

Parameters

pDO
IDataObject

[in] IDataObject to be added to the References tab in the Toolbox.

ptif
TBXITEMINFO[]

[in] Structure identifying item characteristics, such as the item name and icon. For more information, see TBXITEMINFO.

lpszTab
String

[in] The localized name of the Toolbox tab to add the data object to. The localized name can be obtained from the invariant non-localized name by calling GetIDOfTab(String, String)

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsToolbox::AddItem(  
   [in]IDataObject* pDO,  
   [in]PTBXITEMINFO ptif,  
   [in]LPCOLESTR lpszTab  
);  

Applies to