Editor for WinForms | ComponentOne
C1.Win.C1Editor.4.8 Assembly / C1.Win.C1Editor Namespace / C1TextRange Class / IsStyleApplied Method
The CSS property name.
Example

In This Topic
    IsStyleApplied Method
    In This Topic
    Returns a value indicating whether the inline style is applied to all text within the C1TextRange.
    Syntax
    'Declaration
     
    Public Function IsStyleApplied( _
       ByVal propertyName As System.String _
    ) As System.Boolean
    public System.bool IsStyleApplied( 
       System.string propertyName
    )

    Parameters

    propertyName
    The CSS property name.

    Return Value

    True, if the CSS class is applied to the range; otherwise, False.
    Example
    The example demonstrates a function which determines whether or not selected text is underlined.
    function IsUnderline()
    {
           if (_editor.Mode == EditorMode.Design)
           {
               bool res = false;
               if (_editor.Selection.IsStyleApplied("text-decoration"))
                   res = string.Compare(_editor.Selection.GetStyleValue("text-decoration", C1StyleType.Character), "underline", true) == 0;
               return res;
           }
           else
               return false;
    }
    See Also