+ Reply to Thread
Results 1 to 6 of 6

Thread: How to set background color in TOC?

  1. #1
    Mathias Westin
    Join Date
    Dec 2009
    Posts
    27
    Points
    0
    Answers Provided
    0


    0

    Default How to set background color in 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.
    Best Regards
    Mathias Westin
    Xlent Consulting Group
    Sweden
    http://gis.stackexchange.com/

  2. #2
    vincent Lahaye
    Join Date
    Jun 2010
    Posts
    53
    Points
    0
    Answers Provided
    0


    0

    Default Re: How to set background color in TOC?

    Hi,

    i never used that, but maybe IMapControl4.backcolor could be the solution. But i'm not sure!


    Vincent

  3. #3
    Mathias Westin
    Join Date
    Dec 2009
    Posts
    27
    Points
    0
    Answers Provided
    0


    0

    Default Re: How to set background color in TOC?

    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?
    Best Regards
    Mathias Westin
    Xlent Consulting Group
    Sweden
    http://gis.stackexchange.com/

  4. #4
    Mathias Westin
    Join Date
    Dec 2009
    Posts
    27
    Points
    0
    Answers Provided
    0


    0

    Default Re: How to set background color in TOC?

    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.
    Best Regards
    Mathias Westin
    Xlent Consulting Group
    Sweden
    http://gis.stackexchange.com/

  5. #5
    Venkata Rao Tammineni

    Join Date
    Aug 2010
    Posts
    443
    Points
    0
    Answers Provided
    0


    0

    Default Re: How to set background color in TOC?

    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

  6. #6
    Mathias Westin
    Join Date
    Dec 2009
    Posts
    27
    Points
    0
    Answers Provided
    0


    0

    Default Re: How to set background color in TOC?

    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.
    Best Regards
    Mathias Westin
    Xlent Consulting Group
    Sweden
    http://gis.stackexchange.com/

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts