Editor for WinForms | ComponentOne
C1.Win.C1Editor.4.5.2 Assembly / C1.Win.C1Editor Namespace / C1TextRange Class / ApplyStyle Method / ApplyStyle(String,String) Method
Name of CSS property.
CSS value.
Example

In This Topic
    ApplyStyle(String,String) Method
    In This Topic
    Applies specified inline style to the range.
    Syntax
    'Declaration
     
    Public Overloads Sub ApplyStyle( _
       ByVal propertyName As System.String, _
       ByVal propertyValue As System.String _
    ) 
    public void ApplyStyle( 
       System.string propertyName,
       System.string propertyValue
    )

    Parameters

    propertyName
    Name of CSS property.
    propertyValue
    CSS value.
    Example
    This example converts a Color value to a CSS value and sets it as the background color of the selected range.
    string htmlColor = ColorTranslator.ToHtml(value);
    c1Editor1.Selection.ApplyStyle("background-color", htmlColor);
    See Also