2
public void LabelOff( IActiveView view, IGeoFeatureLayer geoFeatureLayer ) {
    IAnnotateLayerPropertiesCollection annotationProperties =
        geoFeatureLayer.AnnotationProperties;
        annotationProperties.Clear();
        geoFeatureLayer.DisplayAnnotation = false;
        // Which one?
        view.PartialRefresh( esriViewDrawPhase.esriViewGraphics, 
            geoFeatureLayer, null );
        view.Refresh();
}

I use this code to remove labels for one specific layer. It only works with the view.Refresh(). Shouldn't the PartialRefresh() also work (without calling the view.Refresh()?)

  • I'm not in front of my computer now (so I can't check), but I'd play with the esriViewDrawPhase parameter. Perhaps esriViewDrawPhase.esriViewGeography will work. You're right, though, the PartialRefresh should be enough. – Michael Todd Nov 30 '11 at 22:31
  • Tried them all and I can report that esriViewAll works (but isn't that the same as Refresh()?) – Chaz Dec 2 '11 at 15:15
  • Probably. But, if it works, I'd go with it. You can't get any deeper in the process than a refresh will do, and I can't imagine that doing one takes significantly longer than the other. – Michael Todd Dec 2 '11 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.