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


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

IGridLabel Interface

Provides access to members that control the way a map grid is labeled. Note: the IGridLabel interface has been superseded by IGridLabel2. Please consider using the more recent version.

Product Availability

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

Members

Name Description
Read-only property Applies Indicates if this grid label can be used with the specified map grid.
Read/write property Color The color of the grid label.
Read-only property DisplayName The display name for the type of grid label.
Method Draw Draws a label on the specified grid axis.
Read/write property EditObject The interface to an object that can be edited with a property sheet. The object is either the grid label itself or a single editable property.
Read/write property Font The font used by the grid label.
Read/write property LabelAlignment Indicates if the grid label is horizontal (true) or vertical (false) on the specified axis.
Read/write property LabelOffset The offset of the grid label from the border in points.
Method Preview Draws a preview of the grid label into the specified hdc.
Method QueryTextExtent Determines the extent of a label's text on the specified grid axis.

Classes that implement IGridLabel

Classes Description
BackgroundTabStyle A background tab style grid label for index grids.
ButtonTabStyle A button tab style grid label for index grids.
ContinuousTabStyle A continuous tab style grid label for index grids.
CornerGridLabel A grid label with special corner display properties.
DMSGridLabel A grid label in degrees, minutes and seconds.
FormattedGridLabel A grid label that uses a formatted number.
MixedFontGridLabel A grid label that uses mixed fonts.
RoundedTabStyle A rounded tab style grid label for index grids.

Remarks

A grid label object is associated with every map grid object and provides the functionality required to draw labels around the map grid.
The IGridLabel interface holds properties common to all types of grid labels. Not all grid labels can be used with all types of grids. The Applies property of IGridLabel returns True if the grid label can be used with the grid that you pass in as argument. The table below lists the types of labels that can be used with each grid type.
Using the DisplayName property, you can list the type of label that the IGridLabel interface is pointing to. The strings returned for the various label types are also listed in the table.


You can control the vertical or horizontal orientation of the labels along each of the four sides of the grid using the LabelAlignment property. You specify which axis you are setting the property for using an esriGridAxisEnum enumeration.