event AfterExpandItem (Item as HITEM)

Fired after an item is expanded (collapsed).

TypeDescription
Item as HITEM A long expression that indicates the item's handle that indicates the item expanded or collapsed.

The AfterExapndItem event notifies your application that an item is collapsed or expanded. Use the ExpandItem method to programmatically expand or collapse an item. The ExpandItem property also specifies whether an item is expand or collapsed. The ItemChild property retrieves the first child item. Use the BeforeExpandItem event to cancel expanding or collapsing items. 

Syntax for AfterExpandItem event, /NET version, on:

private void AfterExpandItem(object sender,int Item)
{
}

Private Sub AfterExpandItem(ByVal sender As System.Object,ByVal Item As Integer) Handles AfterExpandItem
End Sub

Syntax for AfterExpandItem event, /COM version, on:

private void AfterExpandItem(object sender, AxEXTREELib._ITreeEvents_AfterExpandItemEvent e)
{
}

void OnAfterExpandItem(long Item)
{
}

void __fastcall AfterExpandItem(TObject *Sender,Extreelib_tlb::HITEM Item)
{
}

procedure AfterExpandItem(ASender: TObject; Item : HITEM);
begin
end;

procedure AfterExpandItem(sender: System.Object; e: AxEXTREELib._ITreeEvents_AfterExpandItemEvent);
begin
end;

begin event AfterExpandItem(long Item)
end event AfterExpandItem

Private Sub AfterExpandItem(ByVal sender As System.Object, ByVal e As AxEXTREELib._ITreeEvents_AfterExpandItemEvent) Handles AfterExpandItem
End Sub

Private Sub AfterExpandItem(ByVal Item As EXTREELibCtl.HITEM)
End Sub

Private Sub AfterExpandItem(ByVal Item As Long)
End Sub

LPARAMETERS Item

PROCEDURE OnAfterExpandItem(oTree,Item)
RETURN

Syntax for AfterExpandItem event, /COM version (others), on:

<SCRIPT EVENT="AfterExpandItem(Item)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function AfterExpandItem(Item)
End Function
</SCRIPT>

Procedure OnComAfterExpandItem HITEM llItem
	Forward Send OnComAfterExpandItem llItem
End_Procedure

METHOD OCX_AfterExpandItem(Item) CLASS MainDialog
RETURN NIL

void onEvent_AfterExpandItem(int _Item)
{
}

function AfterExpandItem as v (Item as OLE::Exontrol.Tree.1::HITEM)
end function

function nativeObject_AfterExpandItem(Item)
return

The following VB sample prints the item's state when it is expanded or collapsed:

Private Sub Tree1_AfterExpandItem(ByVal Item As EXTREELibCtl.HITEM)
    Debug.Print "The " & Item & " item was " & IIf(Tree1.Items.ExpandItem(Item), "expanded", "collapsed")
End Sub

The following C# sample prints the item's state when it is expanded or collapsed:

private void axTree1_AfterExpandItem(object sender, AxEXTREELib._ITreeEvents_AfterExpandItemEvent e)
{
	System.Diagnostics.Debug.WriteLine( axTree1.Items.get_ExpandItem( e.item) ? "expanded" : "collapsed" );
}

The following VB.NET sample prints the item's state when it is expanded or collapsed:

Private Sub AxTree1_AfterExpandItem(ByVal sender As Object, ByVal e As AxEXTREELib._ITreeEvents_AfterExpandItemEvent) Handles AxTree1.AfterExpandItem
    Debug.WriteLine(IIf(AxTree1.Items.ExpandItem(e.item), "expanded", "collapsed"))
End Sub

The following C++ sample prints the item's state when it is expanded or collapsed:

void OnAfterExpandItemTree1(long Item) 
{
	CItems items = m_tree.GetItems();
	CString strFormat;
	strFormat.Format( "%s", items.GetExpandItem( Item ) ? "expanded" : "collapsed" );
	OutputDebugString( strFormat );
}

The following VFP sample sample prints the item's state when it is expanded or collapsed:

*** ActiveX Control Event ***
LPARAMETERS item

with thisform.Tree1.Items
	if ( .ExpandItem(item) )
		wait window "expanded" nowait
	else
		wait window "collapsed" nowait
	endif
endwith