ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Element Class / IsLocked Property
Example

In This Topic
    IsLocked Property (Element)
    In This Topic
    Gets the locked state of an element.
    Syntax
    public virtual bool IsLocked {get;}
    Public Overridable ReadOnly Property IsLocked As Boolean

    Property Value

    Type: Boolean
    Remarks
    Returns true if an element is checked on in the table of contents.
    Example
    Element_SetLocked
    //Modify an element's locked state if it isn't already
    
    //Perform on the worker thread
    await QueuedTask.Run(() =>
    {
      if (!element.IsLocked)
      {
        element.SetLocked(true);
      }
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also