property File.Selected as Boolean

Specifies whether the file is selected or unselected.

TypeDescription
Boolean A boolean expression that indicates whether the file/folder is selected or unselected.

The Selected property specifies whether the file or folder is selected or unselected. The StateChange event is fired, when the user changes the selection. Use the Get property to get all selected files/folders in the current list. Use the BrowseFolderPath property to specify the path to the browsed folder. Use the Folder property to specify whether the File object hosts a file or a folder. Use the SelForeColor and SelBackColor properties to specify the foreground and background colors for selected items. You can use the Expand method to expand the parent if necessary, ensures that the giving path fits the control's area and select it.

The following VB sample selects the ''WINNT" folder:

With ExFileView1.Get(AllItems).Item("WINNT")
    .Selected = True
End With

The following VB enumerates the selected files and folders:

Dim i As Long
With ExFileView1.Get(SelItems)
    For i = 0 To .Count - 1
        Debug.Print .Item(i).FullName
    Next
End With

The following C++ sample selects the ''WINNT" folder:

CFile1 file = m_fileview.GetGet( 1 /*AllItems*/ ).GetItem(COleVariant( "WINNT" ));
file.SetSelected( TRUE );

The following C++ enumerates the selected files and folders:

CFiles files = m_fileview.GetGet( 0 /*SelItems*/ );
for ( long i = 0; i < files.GetCount(); i++ )
	OutputDebugString( files.GetItem( COleVariant( i ) ).GetFullName() );

The following VB.NET sample selects the ''WINNT" folder:

With AxExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.AllItems).Item("WINNT")
    .Selected = True
End With

The following VB.NET enumerates the selected files and folders:

With AxExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.SelItems)
    Dim i As Integer
    For i = 0 To .Count - 1
        Debug.WriteLine(.Item(i).FullName)
    Next
End With

The following C# sample selects the ''WINNT" folder:

EXFILEVIEWLib.File file = axExFileView1.get_Get(EXFILEVIEWLib.TypeEnum.AllItems)["WINNT"];
file.Selected = true;

The following C# enumerates the selected files and folders:

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.FullName);
}

The following VFP sample selects the ''WINNT" folder:

With thisform.ExFileView1.Get( 1 ).Item("WINNT")
	.Selected = .t.
EndWith

The following C# enumerates the selected files and folders: 

with thisform.ExFileView1.Get( 0 ) && SelItems
 	local i
 	for i = 0 to .Count - 1
		with .Item(i)
			wait window nowait .FullName
		endwith 		
 	next
 endwith