Skip to main content
You are viewing help content for pre-release software. This document and the features it describes are subject to change.
All docs
V26.2
  • Icon.Parse(String) Method

    Converts the string representation of an icon to an Icon object.

    Namespace: DevExpress.IconLibrary

    Assembly: DevExpress.Data.v26.2.dll

    Declaration

    public static Icon Parse(
        string value
    )

    Parameters

    Name Type Description
    value String

    The string representation of the icon (for example, “icon/add;Fluent;Size16”).

    Returns

    Type Description
    Icon

    The icon that corresponds to the specified string.

    Remarks

    The string contains the icon identifier (the “icon/“ prefix followed by the icon name) followed by property values separated by semicolons. Property values are IconSet, IconPalette, and/or IconSize enumeration members.

    To compose a string, specify the icon identifier first. Property values specified after the identifier are case-insensitive, optional, and their order is arbitrary. Omitted settings are set to Default.

    // Example string
    
    "icon/add;Fluent;Size16"
    

    The method throws the following exceptions:

    • ArgumentNullException - the value is null.
    • FormatException - the icon identifier is empty or the string contains an unknown setting value.

    Use the TryParse(String, out Icon) method to convert a string without exceptions.

    See Also