ArcObjects Library Reference (Carto)  

IGridLabel Interface

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

Product Availability

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

Members

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.

CoClasses that implement IGridLabel

CoClasses and 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.

.NET Related Topics

Creating map grid labels | How to create map grids |