ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMBasicFeatureLayer Class / SelectionColor Property
Example

In This Topic
    SelectionColor Property (CIMBasicFeatureLayer)
    In This Topic
    Gets or sets the selection color. For polygons, this is used as the outline color.
    Syntax
    Public Property SelectionColor As CIMColor
    public CIMColor SelectionColor {get; set;}
    Example
    Change the layer selection color
    {
        // get the CIM definition of the layer
        // Note: needs to be called on the MCT
        var layerDef = featureLayer.GetDefinition() as ArcGIS.Core.CIM.CIMBasicFeatureLayer;
        // disable the default symbol
        layerDef.UseSelectionSymbol = false;
        // assign a new color
        layerDef.SelectionColor = ColorFactory.Instance.RedRGB;
        // apply the definition to the layer
        featureLayer.SetDefinition(layerDef);
    
        if (!featureLayer.IsVisible)
            featureLayer.SetVisibility(true);
        //Do a selection
        MapView.Active.SelectFeatures(MapView.Active.Extent);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also