PROBLEM
At ArcGIS 9.3 and 9.3 Service Pack 1, ForceElementLayer implements the IEnumAttributeLabel interface. Therefore, to change label visibility programmatically at 9.3 and 9.3 SP1 on a ForceElementLayer, implement the code given below.
The cause is due to an API change.
Code:
// Example (C#) : Turn on all labels off a ForceElementLayer CoClass named “MoleForceElementLayer”
// Changed at 9.3
IEnumAttributeLabel pEnumLabel = MoleForceElementLayer as IEnumAttributeLabel;
pEnumLabel.Reset();
for (int i = 0; i < pEnumLabel.Count; i++)
{
IAttributeLabel pAttrib = pEnumLabel.NextLabel();
pAttrib.IsVisible = true;
}
((ICachedGraphicLayer) MoleForceElementLayer).Refresh();
Article ID:000010084
Get help from ArcGIS experts
Download the Esri Support App