IVsUIShell4::CreateToolbarTray Method (IOleCommandTarget^, IVsToolbarTrayHost^)

 

Attaches toolbars that are not contained inside a IVsWindowFrame.

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

int CreateToolbarTray(
	IOleCommandTarget^ pCmdTarget,
	[OutAttribute] IVsToolbarTrayHost^% ppToolbarTrayHost
)

Parameters

pCmdTarget
Type: Microsoft.VisualStudio.OLE.Interop::IOleCommandTarget^

[in] The command target for the tool bar.

ppToolbarTrayHost
Type: Microsoft.VisualStudio.Shell.Interop::IVsToolbarTrayHost^

[out] The toolbar tray host.

Return Value

Type: System::Int32

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

This method is similar to the SetupToolbar() alternatives, but allows you to attach toolbars that are not contained inside a IVsWindowFrame, such as dialogs. The IVsToolbarTrayHost instance it returns allows you to add toolbars and to retrieve the IVsUIElement that represents the UI element for the toolbar tray.

Return to top
Show: