ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / IElement Interface / SetCustomProperty Method / SetCustomProperty(String,String) Method
String
String

In This Topic
    SetCustomProperty(String,String) Method
    In This Topic
    Sets a CustomProperty value for the element. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Overloads Sub SetCustomProperty( _
       ByVal key As String, _
       ByVal value As String _
    ) 
    void SetCustomProperty( 
       string key,
       string value
    )

    Parameters

    key
    String
    value
    String
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Remarks
    This method was created so developers have a way to uniquely assign a value or multiple values to an element that can not be changed in the UI and therefore provides a predictable way to find an element. Each entry has a key/value pair and you find the value using the GetCustomProperty method. You can overwrite values simply be reentering the same key with a different value. There are no methods to remove keys.
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also