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:

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

 


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.