Editor for WinForms | ComponentOne
C1.Win.C1Editor.4.5.2 Assembly / C1.Win.C1Editor Namespace / C1TextRange Class / RemoveStyle Method
Name of the inline style.
CSS value of the inline style.
Example

In This Topic
    RemoveStyle Method
    In This Topic
    Removes the specified inline style.
    Syntax
    'Declaration
     
    Public Sub RemoveStyle( _
       ByVal propertyName As System.String, _
       ByVal propertyValue As System.String _
    ) 
    public void RemoveStyle( 
       System.string propertyName,
       System.string propertyValue
    )

    Parameters

    propertyName
    Name of the inline style.
    propertyValue
    CSS value of the inline style.
    Remarks
    If propertyValue is null, the function removes specified inline style with any value.
    Example
    This example removes specified color from the selected text. If the value is null it applies default color to the text.
    function SetColor(Color value)
    {
           if (value.IsEmpty)
               _editor.Selection.RemoveStyle("color", null);
           else
           {
               string foreColor = System.Drawing.ColorTranslator.ToHtml(value);
               _editor.Selection.ApplyStyle("color", foreColor, C1StyleType.Character);
           }
    }
    See Also