This document is archived and information here might be outdated.  Recommended version.

IMxDocument.DefaultColor Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > ArcMapUI > ESRI.ArcGIS.ArcMapUI > Interfaces > IM > IMxDocument Interface > IMxDocument.DefaultColor Property
ArcGIS Developer Help

IMxDocument.DefaultColor Property

The default color for the given type.

[Visual Basic .NET]
Public Function get_DefaultColor ( _
    ByVal Type As esriMxDefaultColorTypes _
) As IColor
[Visual Basic .NET]
Public Sub set_DefaultColor ( _
    ByVal Type As esriMxDefaultColorTypes, _
    ByVal color As IColor _
public IColor get_DefaultColor (
    esriMxDefaultColorTypes Type
public void set_DefaultColor (
    esriMxDefaultColorTypes Type,
    IColor color

Product Availability

Available with ArcGIS Desktop.


This one property accesses the default color object for each of the four available default symbol types.  Types include: text, fill, line, and marker symbols.  Access each default color object by passing a different value for Type from the the esriMxDefaultColorTypes enumeration.

All new graphics created with the Draw toolbar in ArcMap are initially drawn using their associated default symbol.  You can use this property to change the color of these default symbols. For example, to have new polygon graphics drawn in blue, create a new color object, assign it a blue color, and then set it as the new default fill symbol color.  After this, all new rectangle, polygon, circle, and ellipse graphics created in ArcMap will be initially drawn with a blue fill color.

You can acccess each default symbol individually via IDocumentDefaultSymbols.


See Also

IMxDocument Interface | esriMxDefaultColorTypes Constants