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

ILegendItem2 Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IL > ILegendItem2 Interface
ArcGIS Developer Help

ILegendItem2 Interface

Provides access to members that control how a layer appears in a legend. Can be stored in a style. Note: the ILegendItem2 interface has been superseded by ILegendItem3. Please consider using the more recent version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Name Description
Read-only property CanDisplay Indicates if the style is compatible with the specified layer.
Method ChangeFlowDirection Indicates if a legend's flow direction changes. Update alignment settings.
Read/write property Columns Number of columns in the legend item.
Method CreateGraphics Rebuilds the list of graphics. Call whenever the associated layer changes.
Read-only property Graphics List of graphics that represent the legend item. Must call CreateGraphics first.
Read/write property GroupIndex Zero-based index of the legend group shown by this item. Use -1 to show all legend groups using this item.
Read/write property HeadingSymbol Text symbol used to draw the heading.
Read-only property Height Height of the item in points. Must call CreateGraphics first.
Read/write property KeepTogether Indicates if classes must appear in a single column or whether they can be split across multiple columns.
Read/write property Layer Associated layer.
Read/write property LayerNameSymbol Text symbol used to draw the layer name.
Read/write property LegendClassFormat Default formatting information for the legend classes. Renderer may override.
Read-only property Name Name of the style.
Read/write property NewColumn Indicates if the item starts a new column in the legend.
Read/write property ShowDescriptions Indicates if descriptions are visible.
Read/write property ShowHeading Indicates if heading is visibile.
Read/write property ShowLabels Indicates if labels are visible.
Read/write property ShowLayerName Indicates if layer name is visibile.
Read-only property Width Width of the item in points. Must call CreateGraphics first.

Classes that implement ILegendItem2

Classes Description
HorizontalBarLegendItem Horizontal bar legend item.
HorizontalLegendItem Horizontal legend item.
NestedLegendItem Nested legend item.
VerticalLegendItem Vertical legend item.