event BeforeCollapse (SelFolder as ExShellFolder, ByRef Cancel as Boolean)
Fired before a folder is about to collapse.

TypeDescription
SelFolder as ExShellFolder A Folder being collapsed
Cancel as Boolean (By Reference) A Boolen expression that indicates whether the operation is canceled or not.
When the user double clicks on a folder, or on a 'plus' button next to folder, it expands. If it was already expanded, it collapses. When the folder collapses, two events are fired. BeforeCollapse is fired before ExFolderView changes its structure, so some additional functions can be executed. The AfterCollapse event is fired after the structure has changed. Usually, expanding and collapsing folders will result in more or fewer folders being visible after this event, so if some additional code is required it should be put inside this event body.

Syntax for BeforeCollapse event, /NET version, on:

private void BeforeCollapse(object sender,exontrol.EXFOLDERVIEWLib.ExShellFolder SelFolder,ref bool Cancel)
{
}

Private Sub BeforeCollapse(ByVal sender As System.Object,ByVal SelFolder As exontrol.EXFOLDERVIEWLib.ExShellFolder,ByRef Cancel As Boolean) Handles BeforeCollapse
End Sub

Syntax for BeforeCollapse event, /COM version, on:

private void BeforeCollapse(object sender, AxEXFOLDERVIEWLib._IExFolderViewEvents_BeforeCollapseEvent e)
{
}

void OnBeforeCollapse(LPDISPATCH SelFolder,BOOL FAR* Cancel)
{
}

void __fastcall BeforeCollapse(TObject *Sender,Exfolderviewlib_tlb::IExShellFolder *SelFolder,VARIANT_BOOL * Cancel)
{
}

procedure BeforeCollapse(ASender: TObject; SelFolder : IExShellFolder;var Cancel : WordBool);
begin
end;

procedure BeforeCollapse(sender: System.Object; e: AxEXFOLDERVIEWLib._IExFolderViewEvents_BeforeCollapseEvent);
begin
end;

begin event BeforeCollapse(oleobject SelFolder,boolean Cancel)
end event BeforeCollapse

Private Sub BeforeCollapse(ByVal sender As System.Object, ByVal e As AxEXFOLDERVIEWLib._IExFolderViewEvents_BeforeCollapseEvent) Handles BeforeCollapse
End Sub

Private Sub BeforeCollapse(ByVal SelFolder As EXFOLDERVIEWLibCtl.IExShellFolder,Cancel As Boolean)
End Sub

Private Sub BeforeCollapse(ByVal SelFolder As Object,Cancel As Boolean)
End Sub

LPARAMETERS SelFolder,Cancel

PROCEDURE OnBeforeCollapse(oExFolderView,SelFolder,Cancel)
RETURN

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

<SCRIPT EVENT="BeforeCollapse(SelFolder,Cancel)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function BeforeCollapse(SelFolder,Cancel)
End Function
</SCRIPT>

Procedure OnComBeforeCollapse Variant llSelFolder Boolean llCancel
	Forward Send OnComBeforeCollapse llSelFolder llCancel
End_Procedure

METHOD OCX_BeforeCollapse(SelFolder,Cancel) CLASS MainDialog
RETURN NIL

void onEvent_BeforeCollapse(COM _SelFolder,COMVariant /*bool*/ _Cancel)
{
}

function BeforeCollapse as v (SelFolder as OLE::Exontrol.FolderView.1::IExShellFolder,Cancel as L)
end function

function nativeObject_BeforeCollapse(SelFolder,Cancel)
return