How to change the color of a layer in map

Hello,

I select a layer and then go to a context menu property to change the layer’s color.
This seems very simple, but it got me. Will someone share some code?
Thanks!

Hello @lang

Each layer has it’s own set of ShapeDrawingOptions that control the default rendering. This can be accessed through the Shapefiles DefaultDrawingOptions property.

There are also some top-level (AxMap) functions that can be used to set the various properties in each Shapefiles ShapeDrawingOptions. You might try starting with these.

Regards.

Thank you Jerry!
Is the following ok? how do we set the color exactly? Can I pass in my own color?
Utils utils = new Utils();
sf = axMap1.get_Shapefile(layerHandle);
ShapeDrawingOptions options = sf.DefaultDrawingOptions;
options.FillColor = utils.ColorByName(tkMapColor.Red);

        axMap1.Redraw();