ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureLayer Class / IsLabelVisible Property
Example

In This Topic
    IsLabelVisible Property (FeatureLayer)
    In This Topic
    Gets whether labels are drawing
    Syntax
    public bool IsLabelVisible {get;}
    Public ReadOnly Property IsLabelVisible As Boolean
    Example
    Enable labeling on a layer
    var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      // toggle the label visibility
      featureLayer.SetLabelVisibility(!featureLayer.IsLabelVisible);
    });
    Enable labeling of a layer
    //Note: call within QueuedTask.Run()
    
    if (!featureLayer.IsLabelVisible)
      //set the label's visiblity
      featureLayer.SetLabelVisibility(true);
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also