property Item.UseForeColor as Boolean
Retrieves or sets a value that indicates whether the item's foreground color is specified by ForeColor property.

TypeDescription
Boolean A boolean expression that indicates whether the item's foreground color is specified by ForeColor property.

The UseBackColor property specifies whether the ForeColor property has effect. The UseForeColor property is set on True, when the user changes the ForeColor property. 

The following VB sample changes the foreground color for the item with the identifier 50:

With ExMenu1.Item(50)
    .ForeColor = vbRed
End With

The following C++ sample changes the foreground color for the item with the identifier 50:

CItem item = m_menu.GetItem( COleVariant( long( 50 ) ) );
item.SetForeColor( RGB(255,0,0) );

The following VB.NET sample changes the foreground color for the item with the identifier 50:

With AxExMenu1.item(50)
    .ForeColor = ToUInt32(Color.Red)
End With

where the ToUInt32 function converts a Color expression to OLE_COLOR:

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 item with the identifier 50:

EXMENULib.item item = axExMenu1[50];
item.ForeColor = ToUInt32(Color.Red);

where the ToUInt32 function converts a Color expression to OLE_COLOR:

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 item with the identifier 50:

With thisform.ExMenu1.Item(50)
	.ForeColor = RGB(255,0,0)
EndWith