exfolderview - sample code

Can I assign partial check boxes to folders, so the sub folders get checked when the user checks the parent folder?

VBA (MS Access, Excell...)

With ExFolderView1
	.HasCheckBoxes = True
	.PartialCheck = True
	.FirstVisibleFolder.Check = True
End With

VB6

With ExFolderView1
	.HasCheckBoxes = True
	.PartialCheck = True
	.FirstVisibleFolder.Check = True
End With

VB.NET

With Exfolderview1
	.HasCheckBoxes = True
	.PartialCheck = True
	.FirstVisibleFolder.Check = True
End With

VB.NET for /COM

With AxExFolderView1
	.HasCheckBoxes = True
	.PartialCheck = True
	.FirstVisibleFolder.Check = True
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXFOLDERVIEWLib' for the library: 'ExFolderView 1.0 Control Library'

	#import <ExFolderView.dll>
	using namespace EXFOLDERVIEWLib;
*/
EXFOLDERVIEWLib::IExFolderViewPtr spExFolderView1 = GetDlgItem(IDC_EXFOLDERVIEW1)->GetControlUnknown();
spExFolderView1->PutHasCheckBoxes(VARIANT_TRUE);
spExFolderView1->PutPartialCheck(VARIANT_TRUE);
spExFolderView1->GetFirstVisibleFolder()->PutCheck(VARIANT_TRUE);

C++ Builder

ExFolderView1->HasCheckBoxes = true;
ExFolderView1->PartialCheck = true;
ExFolderView1->FirstVisibleFolder->Check = true;

C#

exfolderview1.HasCheckBoxes = true;
exfolderview1.PartialCheck = true;
exfolderview1.FirstVisibleFolder.Check = true;

JavaScript

<OBJECT classid="clsid:10670A99-FCCC-415C-8127-176332842618" id="ExFolderView1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	ExFolderView1.HasCheckBoxes = true;
	ExFolderView1.PartialCheck = true;
	ExFolderView1.FirstVisibleFolder.Check = true;
</SCRIPT>

C# for /COM

axExFolderView1.HasCheckBoxes = true;
axExFolderView1.PartialCheck = true;
axExFolderView1.FirstVisibleFolder.Check = true;

X++ (Dynamics Ax 2009)

public void init()
{
	;

	super();

	exfolderview1.HasCheckBoxes(true);
	exfolderview1.PartialCheck(true);
	exfolderview1.FirstVisibleFolder().Check(true);
}

Delphi 8 (.NET only)

with AxExFolderView1 do
begin
	HasCheckBoxes := True;
	PartialCheck := True;
	FirstVisibleFolder.Check := True;
end

Delphi (standard)

with ExFolderView1 do
begin
	HasCheckBoxes := True;
	PartialCheck := True;
	FirstVisibleFolder.Check := True;
end

VFP

with thisform.ExFolderView1
	.HasCheckBoxes = .T.
	.PartialCheck = .T.
	.FirstVisibleFolder.Check = .T.
endwith

dBASE Plus

local oExFolderView

oExFolderView = form.Activex1.nativeObject
oExFolderView.HasCheckBoxes = true
oExFolderView.PartialCheck = true
oExFolderView.FirstVisibleFolder.Check = true

XBasic (Alpha Five)

Dim oExFolderView as P

oExFolderView = topparent:CONTROL_ACTIVEX1.activex
oExFolderView.HasCheckBoxes = .t.
oExFolderView.PartialCheck = .t.
oExFolderView.FirstVisibleFolder.Check = .t.

Visual Objects


oDCOCX_Exontrol1:HasCheckBoxes := true
oDCOCX_Exontrol1:PartialCheck := true
oDCOCX_Exontrol1:FirstVisibleFolder:Check := true

PowerBuilder

OleObject oExFolderView

oExFolderView = ole_1.Object
oExFolderView.HasCheckBoxes = true
oExFolderView.PartialCheck = true
oExFolderView.FirstVisibleFolder.Check = true

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Set ComHasCheckBoxes to True
	Set ComPartialCheck to True
	Variant voExShellFolder
	Get ComFirstVisibleFolder to voExShellFolder
	Handle hoExShellFolder
	Get Create (RefClass(cComExShellFolder)) to hoExShellFolder
	Set pvComObject of hoExShellFolder to voExShellFolder
		Set ComCheck of hoExShellFolder to True
	Send Destroy to hoExShellFolder
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oExFolderView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oExFolderView := XbpActiveXControl():new( oForm:drawingArea )
	oExFolderView:CLSID  := "Exontrol.FolderView.1" /*{10670A99-FCCC-415C-8127-176332842618}*/
	oExFolderView:create(,, {10,60},{610,370} )

		oExFolderView:HasCheckBoxes := .T.
		oExFolderView:PartialCheck := .T.
		oExFolderView:FirstVisibleFolder():Check := .T.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN