Hi!
Does anyone know how to set the background color of the TocControl? The reason we want to do this is so that white symbols and lines will get visible in the TOC.
Hi!
Does anyone know how to set the background color of the TocControl? The reason we want to do this is so that white symbols and lines will get visible in the TOC.
Hi,
i never used that, but maybe IMapControl4.backcolor could be the solution. But i'm not sure!
Vincent
Hi Vincent!
The IMapControl4.BackColor is only changing the background color of the MapControl it doesen't have any effect on the TOCControl. The MapControl is connected to the TOCControl as a buddy so it should be aware of changes in the MapControl.
//OLE_Color = (Red) + (Green * 256) + (Blue * 256 * 256)
((IMapControl4)axMapControl1.Object).BackColor = 255;
I've also tried to set the BackColor on the AxMapControl but it also only effects the MapControl..
axMapControl1.BackColor = Color.Red;
Any other ideas?
Update: We could not find a way to change the color of the TOC. So we change the background of the swatch instead. We did that by looping through layers casting to ILagendInfo and updating the bitmap in the IPictureMarkerSymbol, converting all pixels with background color to gray making the white symbols to show up.

Hi,
You need to play with only TOCControl not for others.
Please check below url http://edndoc.esri.com/arcobjects/9....Appearance.htm
http://edndoc.esri.com/arcobjects/9....OCControl2.htm
http://edndoc.esri.com/arcobjects/9....Appearance.htm
Thanks and Regards,
Venkat Tammineni
We've tried almost everything you can do with the TOCControl and there is no way to change the background color. The only thing we haven't done is try to work with win32 API, that might be a possible way to do it... But the workaround that we done with the swatches is ok for now.
Bookmarks