ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / StyleHelper Class / RemoveStyle Method
The current ArcGIS Pro project from which the style has to be removed.
Name of a core ArcGIS Pro style or the full path to a style file (.stylx) on disk that has to be removed from the current project.
Example

In This Topic
    RemoveStyle Method
    In This Topic
    Removes the specified style from the current project. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Shared Sub RemoveStyle( _
       ByVal project As Project, _
       ByVal styleName As String _
    ) 
    public static void RemoveStyle( 
       Project project,
       string styleName
    )

    Parameters

    project
    The current ArcGIS Pro project from which the style has to be removed.
    styleName
    Name of a core ArcGIS Pro style or the full path to a style file (.stylx) on disk that has to be removed from the current project.
    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run
    Example
    How to remove a style from project
    {
        //For ArcGIS Pro system styles, just pass in the name of the style to remove from the project
        //Note: Needs QueuedTask to run
        StyleHelper.RemoveStyle(Project.Current, "3D Vehicles");
    
        //For custom styles, pass in the full path to the style file on disk
        //Note: Needs QueuedTask to run
        string customStyleToAdd = @"C:\Temp\CustomStyle.stylx";
        StyleHelper.RemoveStyle(Project.Current, customStyleToAdd);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also