property FileType.ForeColor as Color

Retrieves or sets a value that indicates the foreground color for the files that match the FileType's pattern.

TypeDescription
Color A color expression that defines the foreground color for the files that match the FileType's pattern.

Use the BackColor and ForeColor properties to color your items that match a pattern. The Apply method applies the changes to the current list.  Use the BrowseFolderPath property to specify the path to the browsed folder. Use the ForeColor property to specify the control's foreground color. Use the ForeColor property to specify the file/folder's foreground color.

The following VB sample changes the foreground color for the exe files:

With ExFileView1.FileTypes
    .Add("*.exe").ForeColor = vbRed
    .Apply
End With

The following C++ sample changes the foreground color for the exe files:

#include "FileType.h"
#include "FileTypes.h"
CFileType fileType = m_fileview.GetFileTypes().Add("*.exe");
fileType.SetForeColor( RGB(255,0,0) );
fileType.Apply();

The following VB.NET sample changes the foreground color for the exe files:

With AxExFileView1.FileTypes.Add("*.exe")
    .ForeColor = ToUInt32(Color.Red)
    .Apply()
End With

where the ToUInt32 function converts a Color expression to OLE_COLOR type,

Shared Function ToUInt32(ByVal c As Color) As UInt32
    Dim i As Long
    i = c.R
    i = i + 256 * c.G
    i = i + 256 * 256 * c.B
    ToUInt32 = Convert.ToUInt32(i)
End Function

The following C# sample changes the foreground color for the exe files:

EXFILEVIEWLib.FileType fileType = axExFileView1.FileTypes.Add("*.exe");
fileType.ForeColor = ToUInt32(Color.Red);
fileType.Apply();

where the ToUInt32 function converts a Color expression to OLE_COLOR type,

private UInt32 ToUInt32(Color c)
{
	long i;
	i = c.R;
	i = i + 256 * c.G;
	i = i + 256 * 256 * c.B;
	return Convert.ToUInt32(i);
}

The following VFP sample changes the foreground color for the exe files:

With thisform.ExFileView1.Add("*.exe")
	.ForeColor = RGB(255,0,0)
	.Apply()
EndWith