Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble finding a way to change the background color of the AxTOCControl. Is there an easy way to do this? I'm using ArcEngine 10 C# and VS2010. Thanks

share|improve this question
up vote 4 down vote accepted

Nope, we could not find a way to do it. See my thread How to set background color in TOC? on the ESRI forum.

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.

Might be a good Idea to vote on this ArcGIS Engine Idea

share|improve this answer

my guess is the first child hwnd under the main AxTocControl's hwnd is the treeview itself (you may want to try the top level one as well). You can use the following (unchecked) code to change a treeview's background color

static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
static int TV_FIRST = 0x1100;
static int TVM_SETBKCOLOR = (TV_FIRST + 29);

private void ChangeBGColor(IntPtr tv_hwnd, Color color)
    int c = System.Drawing.ColorTranslator.ToWin32(color);
    SendMessage(tv_hwnd, TVM_SETBKCOLOR, IntPtr.Zero, new IntPtr(c));
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.