Editor for WinForms | ComponentOne
C1.Win.C1Editor.4.8 Assembly / C1.Win.C1Editor Namespace / C1TextRange Class / IsClassApplied Method
The CSS class name to check.
Example

In This Topic
    IsClassApplied Method
    In This Topic
    Returns a value indicating whether the specified CSS class is applied to the C1TextRange.
    Syntax
    'Declaration
     
    Public Function IsClassApplied( _
       ByVal className As System.String _
    ) As System.Boolean
    public System.bool IsClassApplied( 
       System.string className
    )

    Parameters

    className
    The CSS class name to check.

    Return Value

    True, if the CSS class is applied to the range; otherwise, False.
    Example
    This example updates some UI controls depending on the style of the selected text.
    function UpdateUI()
    {
           if (_editor.Mode == EditorMode.Design)
           {
               _button1.Enabled = _editor.Selection.IsClassApplied("topic");
               _button2.Enabled = _editor.Selection.IsClassApplied("book");   
           }
    }
    See Also