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, AxEXGANTTLib._IGanttEvents_AfterExpandItemEvent e)
{
}

void OnAfterExpandItem(long Item)
{
}

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

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

procedure AfterExpandItem(sender: System.Object; e: AxEXGANTTLib._IGanttEvents_AfterExpandItemEvent);
begin
end;

begin event AfterExpandItem(long Item)
end event AfterExpandItem

Private Sub AfterExpandItem(ByVal sender As System.Object, ByVal e As AxEXGANTTLib._IGanttEvents_AfterExpandItemEvent) Handles AfterExpandItem
End Sub

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

Private Sub AfterExpandItem(ByVal Item As Long)
End Sub

LPARAMETERS Item

PROCEDURE OnAfterExpandItem(oGantt,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.Gantt.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 Gantt1_AfterExpandItem(ByVal Item As EXGANTTLibCtl.HITEM)
    Debug.Print "The " & Item & " item was " & IIf(Gantt1.Items.ExpandItem(Item), "expanded", "collapsed")
End Sub

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

private void axGantt1_AfterExpandItem(object sender, AxEXGANTTLib._IGanttEvents_AfterExpandItemEvent e)
{
	System.Diagnostics.Debug.WriteLine( axGantt1.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 AxGantt1_AfterExpandItem(ByVal sender As Object, ByVal e As AxEXGANTTLib._IGanttEvents_AfterExpandItemEvent) Handles AxGantt1.AfterExpandItem
    Debug.WriteLine(IIf(AxGantt1.Items.ExpandItem(e.item), "expanded", "collapsed"))
End Sub

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

void OnAfterExpandItemGantt1(long Item) 
{
	CItems items = m_gantt.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.Gantt1.Items
	if ( .ExpandItem(item) )
		wait window "expanded" nowait
	else
		wait window "collapsed" nowait
	endif
endwith