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


ILayerDescription.Visible Property (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

ILayerDescription.Visible Property

Indicates whether the layer is visible as defined in the TOC (i.e. marked on).

[Visual Basic .NET]
Public Property Visible As Boolean
[C#]
public bool Visible {get; set;}
[C++]
HRESULT get_Visible(
  VARIANT_BOOL* Visible
);
[C++]
HRESULT put_Visible(
  VARIANT_BOOL Visible
);
[C++]

Parameters Visible [out, retval] Visible is a parameter of type VARIANT_BOOL Visible [in] Visible is a parameter of type VARIANT_BOOL

Product Availability

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

Remarks

This property only reflects the layer's on/off state in the TOC. A layer's visibility property may be TRUE and the layer may still not be visible on the map. This occurs when a layer is marked "on" but is not drawn in the map display because its display is dependent on the scale of the map.

Use VisibleLayers on IMapImage to retrieve an array of layers that are both "on" in the TOC and visible in the map display.

You can also use MinScale and MaxScale on IMapLayerInfo2 to see if the layer has any scale dependencies and then use MapScale on IMapImage or ComputeScale on IMapServer2 to determine the map scale. If the map scale falls outside the specified scale range set for the layer, the layer will not display.  

See Also

ILayerDescription Interface

.NET Related Topics

Map services