event BeforeExpandGroup (Group as Group, ByRef Cancel as Variant)
Occurs just before expanding or collapsing a group.

TypeDescription
Group as Group A Group object being expanded or collapsed.
Cancel as Variant (By Reference) A boolean expression that indicates whether the expanding/collapsing operation is canceled.
Use the BeforeExpandGroup event to disable expanding groups on the fly. Use the AllowExpand property to disable expanding or collapsing groups when user clicks the group's caption. The BeforeExandGroup event notifies your application that a group is expanding or collapsing. The control fires the AfterExpandGroup event after group is expanded or collapsed. Use the Expanded property to expand programmatically the group

Syntax for BeforeExpandGroup event, /NET version, on:

private void BeforeExpandGroup(object sender,exontrol.EXPLORERTREELib.Group Group,ref object Cancel)
{
}

Private Sub BeforeExpandGroup(ByVal sender As System.Object,ByVal Group As exontrol.EXPLORERTREELib.Group,ByRef Cancel As Object) Handles BeforeExpandGroup
End Sub

Syntax for BeforeExpandGroup event, /COM version, on:

private void BeforeExpandGroup(object sender, AxEXPLORERTREELib._IExplorerTreeEvents_BeforeExpandGroupEvent e)
{
}

void OnBeforeExpandGroup(LPDISPATCH Group,VARIANT FAR* Cancel)
{
}

void __fastcall BeforeExpandGroup(TObject *Sender,Explorertreelib_tlb::IGroup *Group,Variant * Cancel)
{
}

procedure BeforeExpandGroup(ASender: TObject; Group : IGroup;var Cancel : OleVariant);
begin
end;

procedure BeforeExpandGroup(sender: System.Object; e: AxEXPLORERTREELib._IExplorerTreeEvents_BeforeExpandGroupEvent);
begin
end;

begin event BeforeExpandGroup(oleobject Group,any Cancel)
end event BeforeExpandGroup

Private Sub BeforeExpandGroup(ByVal sender As System.Object, ByVal e As AxEXPLORERTREELib._IExplorerTreeEvents_BeforeExpandGroupEvent) Handles BeforeExpandGroup
End Sub

Private Sub BeforeExpandGroup(ByVal Group As EXPLORERTREELibCtl.IGroup,Cancel As Variant)
End Sub

Private Sub BeforeExpandGroup(ByVal Group As Object,Cancel As Variant)
End Sub

LPARAMETERS Group,Cancel

PROCEDURE OnBeforeExpandGroup(oExplorerTree,Group,Cancel)
RETURN

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

<SCRIPT EVENT="BeforeExpandGroup(Group,Cancel)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function BeforeExpandGroup(Group,Cancel)
End Function
</SCRIPT>

Procedure OnComBeforeExpandGroup Variant llGroup Variant llCancel
	Forward Send OnComBeforeExpandGroup llGroup llCancel
End_Procedure

METHOD OCX_BeforeExpandGroup(Group,Cancel) CLASS MainDialog
RETURN NIL

void onEvent_BeforeExpandGroup(COM _Group,COMVariant /*variant*/ _Cancel)
{
}

function BeforeExpandGroup as v (Group as OLE::Exontrol.ExplorerTree.1::IGroup,Cancel as A)
end function

function nativeObject_BeforeExpandGroup(Group,Cancel)
return

The following sample disables expanding or collapsing the second group:

Private Sub ExplorerTree1_BeforeExpandGroup(ByVal Group As EXPLORERTREELibCtl.IGroup, Cancel As Variant)
    Cancel = Group.Index = 1
End Sub