This documentation is archived and is not being maintained.

IVsUIHierarchyWindow.ExpandItem Method

Controls the state or appearance of items in the hierarchy.

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

int ExpandItem (
	[InAttribute] IVsUIHierarchy pUIH,
	[InAttribute] uint itemid,
	[InAttribute] EXPANDFLAGS expf
int ExpandItem (
	/** @attribute InAttribute() */ IVsUIHierarchy pUIH, 
	/** @attribute InAttribute() */ UInt32 itemid, 
	/** @attribute InAttribute() */ EXPANDFLAGS expf
function ExpandItem (
	pUIH : IVsUIHierarchy, 
	itemid : uint, 
) : int



[in] IVsUIHierarchy to modify the appearance of.


[in] Identifier of the item in the hierarchy. To change the appearance of the hierarchy itself, set itemid to VSITEMID_ROOT. For a list of itemid values, see VSITEMID.


[in] Specifies the state or appearance of the hierarchy or items within the hierarchy, such as whether the hierarchy or item is expanded, highlighted, or shown in bold font. For a list of expf values, see EXPANDFLAGS.

Return Value

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

COM Signature

From vsshell.idl:

HRESULT IVsUIHierarchyWindow::ExpandItem(
   [in] IVsUIHierarchy* pUIH,
   [in] VSITEMID itemid,
   [in] EXPANDFLAGS expf

Use this method to expand, collapse, bold, or highlight specific items or the hierarchy root itself. Use GetItemState to retrieve the state of the hierarchy set by the ExpandItem method.