property Item.UseBackColor as Boolean
Retrieves or sets a value that indicates whether the item's background color is specified by BackColor property.

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

The UseBackColor property specifies whether the BackColor property has effect. Changing the BackColor property automatically sets the UseBackColor property on True.

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

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

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

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

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

With AxExMenu1.item(50)
    .BackColor = 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 background color for the item with the identifier 50:

EXMENULib.item item = axExMenu1[50];
item.BackColor = 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 background color for the item with the identifier 50:

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