ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Element Class / SetVisible Method
Boolean
Example

In This Topic
    SetVisible Method (Element)
    In This Topic
    Sets the visibility of an element on a page layout. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub SetVisible( _
       ByVal isVisible As Boolean _
    ) 
    public void SetVisible( 
       bool isVisible
    )

    Parameters

    isVisible
    Boolean
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Remarks
    A value of true displays the element on the page layout.
    Example
    Update element properties
    {
      //Update an element's properties.
    
      //Note: Must be on QueuedTask.Run
      //Find a single specific element
      element = layout.FindElement("Rectangle") as Element;
      // update an element's name
      element.SetName("New Name");
    
      // update and element's visibility
      element.SetVisible(true);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also