event StateChange (State as StateChangeEnum)

Fired while the control's state has been changed.

TypeDescription
State as StateChangeEnum A StateChangeEnum value that indicates the new control's state.

The StateChange event notifies your application that the current selection is changed. Use Get property to retrieves the collection of selected files or folders. Use the Name property to specify the name of the file or the folder. Use the Folder property to specify whether an item holds a file or a folder. Use the BrowseFolderPath property to specify the path to the browsed folder.

The StateChange event is fired in one of the following situations:

Syntax for StateChange event, /NET version, on:

private void StateChange(object sender,exontrol.EXFILEVIEWLib.StateChangeEnum State)
{
}

Private Sub StateChange(ByVal sender As System.Object,ByVal State As exontrol.EXFILEVIEWLib.StateChangeEnum) Handles StateChange
End Sub

Syntax for StateChange event, /COM version, on:

private void StateChange(object sender, AxEXFILEVIEWLib._IExFileViewEvents_StateChangeEvent e)
{
}

void OnStateChange(long State)
{
}

void __fastcall StateChange(TObject *Sender,Exfileviewlib_tlb::StateChangeEnum State)
{
}

procedure StateChange(ASender: TObject; State : StateChangeEnum);
begin
end;

procedure StateChange(sender: System.Object; e: AxEXFILEVIEWLib._IExFileViewEvents_StateChangeEvent);
begin
end;

begin event StateChange(long State)
end event StateChange

Private Sub StateChange(ByVal sender As System.Object, ByVal e As AxEXFILEVIEWLib._IExFileViewEvents_StateChangeEvent) Handles StateChange
End Sub

Private Sub StateChange(ByVal State As EXFILEVIEWLibCtl.StateChangeEnum)
End Sub

Private Sub StateChange(ByVal State As Long)
End Sub

LPARAMETERS State

PROCEDURE OnStateChange(oExFileView,State)
RETURN

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

<SCRIPT EVENT="StateChange(State)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function StateChange(State)
End Function
</SCRIPT>

Procedure OnComStateChange OLEStateChangeEnum llState
	Forward Send OnComStateChange llState
End_Procedure

METHOD OCX_StateChange(State) CLASS MainDialog
RETURN NIL

void onEvent_StateChange(int _State)
{
}

function StateChange as v (State as OLE::Exontrol.ExFileView.1::StateChangeEnum)
end function

function nativeObject_StateChange(State)
return

Please check the list of all states in the StateChangeEnum type.

The following VB sample enumerates the selected items:

Private Sub ExFileView1_StateChange(ByVal State As EXFILEVIEWLibCtl.StateChangeEnum)
    If State = SelChangeState Then
        Dim fs As Files, f As File
        Set fs = ExFileView1.Get(SelItems)
        For Each f In fs
            Debug.Print f.Name
        Next
    End If
End Sub

The following C++ sample enumerates the selected items:

void OnStateChangeExfileview1(long State) 
{
	switch ( State )
	{
		case 0: /*StartSearching*/
		{
			OutputDebugString( "Start searching" );
			break;
		}
		case 1: /*EndSearching*/
		{
			OutputDebugString( "End searching" );
			break;
		}
	}
}

The following VB.NET sample enumerates the selected items:

Private Sub AxExFileView1_StateChange(ByVal sender As Object, ByVal e As AxEXFILEVIEWLib._IExFileViewEvents_StateChangeEvent) Handles AxExFileView1.StateChange
    Select Case e.state
        Case EXFILEVIEWLib.StateChangeEnum.SelChangeState
            With AxExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.SelItems)
                Dim i As Integer
                For i = 0 To .Count - 1
                    With .Item(i)
                        Debug.WriteLine(.Name)
                    End With
                Next
            End With
    End Select
End Sub

The following C# sample enumerates the selected items:

private void axExFileView1_StateChange(object sender, AxEXFILEVIEWLib._IExFileViewEvents_StateChangeEvent e)
{
	switch (e.state)
	{
		case EXFILEVIEWLib.StateChangeEnum.SelChangeState:
		{
			EXFILEVIEWLib.Files files = axExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.SelItems);
			for (int i = 0; i < files.Count; i++)
			{
				EXFILEVIEWLib.File file = files[i];
				System.Diagnostics.Debug.WriteLine(file.Name);
			}
			break;
		}
	}
}

The following VFP sample enumerates the selected items:

*** ActiveX Control Event ***
LPARAMETERS state

do case 

 case state = 3 && SelChangeState
 with thisform.ExFileView1.Get( 0 ) && SelItems
 	local i
 	for i = 0 to .Count - 1
		with .Item(i)
			wait window nowait .Name
		endwith 		
 	next
 endwith	
 
endcase