[]
        
(Showing Draft Content)

C1.Win.C1Editor.C1TextRange.ApplyStyle

ApplyStyle Method

ApplyStyle(string, string)

Applies specified inline style to the range.

Declaration
public void ApplyStyle(string propertyName, string propertyValue)
Public Sub ApplyStyle(propertyName As String, propertyValue As String)
Parameters
Type Name Description
string propertyName

Name of CSS property.

string propertyValue

CSS value.

Examples

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);

ApplyStyle(string, string, C1StyleType)

Applies specified inline style to the range.

Declaration
public void ApplyStyle(string propertyName, string propertyValue, C1StyleType type)
Public Sub ApplyStyle(propertyName As String, propertyValue As String, type As C1StyleType)
Parameters
Type Name Description
string propertyName

Name of CSS property.

string propertyValue

CSS value.

C1StyleType type

Defines type of content to which inline style must be applied.