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

TypeDescription
Group as Group A Group object being expanded or collapsed.
Cancel as Boolean (By Reference) A boolean expression that indicates whether the expanding/collapsing operation is canceled.

The BeforeExandGroup event notifies your application that a group is expanding or collapsing. Use the BeforeExapndGroup event to cancel the expanding/collapsing operation. The control fires the ExpandGroup event after group is expanded or collapsed. Use the Expanded property to expand programmatically the group. Use the DisplayExpandIcon property to show or hide the expand icon on the group's caption.

Syntax for BeforeExpandGroup event, /NET version, on:

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

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

Syntax for BeforeExpandGroup event, /COM version, on:

private void BeforeExpandGroup(object sender, AxEXPLORERBARLib._IExplorerBarEvents_BeforeExpandGroupEvent e)
{
}

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

void __fastcall BeforeExpandGroup(TObject *Sender,Explorerbarlib_tlb::IGroup *Group,VARIANT_BOOL * Cancel)
{
}

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

procedure BeforeExpandGroup(sender: System.Object; e: AxEXPLORERBARLib._IExplorerBarEvents_BeforeExpandGroupEvent);
begin
end;

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

Private Sub BeforeExpandGroup(ByVal sender As System.Object, ByVal e As AxEXPLORERBARLib._IExplorerBarEvents_BeforeExpandGroupEvent) Handles BeforeExpandGroup
End Sub

Private Sub BeforeExpandGroup(ByVal Group As EXPLORERBARLibCtl.IGroup,Cancel As Boolean)
End Sub

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

LPARAMETERS Group,Cancel

PROCEDURE OnBeforeExpandGroup(oExplorerBar,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 Boolean llCancel
	Forward Send OnComBeforeExpandGroup llGroup llCancel
End_Procedure

METHOD OCX_BeforeExpandGroup(Group,Cancel) CLASS MainDialog
RETURN NIL

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

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

function nativeObject_BeforeExpandGroup(Group,Cancel)
return

The following VB sample disables expanding or collapsing the first group:

Private Sub ExplorerBar1_BeforeExpandGroup(ByVal Group As EXPLORERBARLibCtl.IGroup, Cancel As Boolean)
    With Group
        If .Index = 0 Then
            Cancel = True
        End If
    End With
End Sub

The following C++ sample disables expanding or collapsing the first group:

void OnBeforeExpandGroupExplorerbar1(LPDISPATCH Group, BOOL FAR* Cancel) 
{
	CGroup group( Group ); group.m_bAutoRelease = FALSE;
	if ( group.GetIndex() == 0 )
		*Cancel = TRUE;
}

The following VB.NET sample disables expanding or collapsing the first group:

Private Sub AxExplorerBar1_BeforeExpandGroup(ByVal sender As Object, ByVal e As AxEXPLORERBARLib._IExplorerBarEvents_BeforeExpandGroupEvent) Handles AxExplorerBar1.BeforeExpandGroup
    With e.group
        If (.Index = 0) Then
            e.cancel = True
        End If
    End With
End Sub

The following C# sample disables expanding or collapsing the first group:

private void axExplorerBar1_BeforeExpandGroup(object sender, AxEXPLORERBARLib._IExplorerBarEvents_BeforeExpandGroupEvent e)
{
	if (e.group.Index == 0)
		e.cancel = true;
}

The following VFP sample disables expanding or collapsing the first group:

*** ActiveX Control Event ***
LPARAMETERS group, cancel

With Group
    If .Index = 0 Then
        Cancel = .t.
    EndIf
EndWith