ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / IElement Interface / GetLockedAspectRatio Method
Example

In This Topic
    GetLockedAspectRatio Method (IElement)
    In This Topic
    Gets the locked aspect ratio value of the element. If This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    bool GetLockedAspectRatio()
    Function GetLockedAspectRatio() As Boolean

    Return Value

    Returns a Boolean
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Returns true if an element has maintain aspect ratio enabled.
    Example
    Element_GetSetLockedAspectRatio
    //Modify an element's aspect ratio. 
    
    //Perform on the worker thread
    await QueuedTask.Run(() =>
    {
      bool elmLocked = element.GetLockedAspectRatio();
      elmLocked = false;  //Turn off the locked state.
    
      element.SetLockedAspectRatio(elmLocked); //You don't have to get to set; a shortcut would be: element.SetLockedAspectRatio(false);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also