property Item.BackColor as Color
Retrieves or sets the item's background color.

 TypeDescription 
   Color A color expression that indicates the item's background color. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part  

Use the BackColor and ForeColor properties to specify the item's background and foreground colors. Use the BackColorList property to specify the default background color for the group's list. Use the BackColor2 property to specify the second background color when painting its background in gradient. Use the BackColor property to specify the control's background color. Use the <bgcolor> built in HTML tag in the Caption property to define portions of text using a specified background color. The BackgroundExt property provides unlimited options to display more colors, icons, HTML, pictures, frames to any item. 

In VB.NET or C# you require the following functions until the .NET framework will provide:

You can use the following VB.NET function:
     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 
You can use the following C# function:
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 VB sample changes the item's background color:

With ExplorerBar1.Groups(0).Item(0)
    .BackColor = vbBlue
End With

The following C++ sample changes the item's background color:

m_explorerbar.GetGroups().GetItem( COleVariant( long(0) ) ).GetItem( COleVariant( long(0) ) ).SetBackColor( RGB(0,0,255) ) ;

The following VB.NET sample changes the item's background color:

With AxExplorerBar1.Groups(0).Item(0)
    .BackColor = ToUInt32(Color.Blue)
End With

The following C# sample changes the item's background color:

axExplorerBar1.Groups[0][0].BackColor = ToUInt32(Color.Blue);

The following VFP sample changes the item's background color:

With thisform.ExplorerBar1.Groups(0).Item(0)
	.BackColor = RGB(0,0,255)
EndWith

 


Send comments on this topic.
1999-2015 Exontrol.COM, Software. All rights reserved.