Initializes a new instance of the FormattedText class from the specified markup text.
Namespace: MindFusion.Spreadsheet.Wpf
Assembly: MindFusion.Spreadsheet.Wpf
C# Copy Code |
---|
public FormattedText ( |
Visual Basic Copy Code |
---|
Public New ( _ |
A markup text specifying the formatted text.
The following table contains the tags that can be used in the text:
Tag | Description |
---|---|
<fontname="value">text</fontname> | Changes the font of the text. The value argument specifies the name of the font. |
<fontsize="value">text</fontsize> | Changes the font size of the text. The value argument specifies the size as a floating point number with dot (.) as a decimal separator. |
<b>text</b> | Indicates bold text. |
<i>text</i> | Indicates italic text. |
<u>text</u> | Indicates underlined text. |
<s>text</s> | Indicates strikeout text. |
<color="#RRGGBB">text</color> | Changes the color of the text. The red green and blue color channels are specified as two-digit hexadecimal numbers. |
Inside the regular text, you must use <, > and & to display respectively the <, > and & symbols.
The following example demonstrates how to create FormattedText objects using this constructor:
C# Copy Code |
---|
FormattedText text = new FormattedText("This is a <b>bold text</b> and <fontsize=\"12\">this text has larger font</fontsize>."); |
Visual Basic Copy Code |
---|
Dim text As New FormattedText("This is a <b>bold text</b> and <fontsize=""12"">this text has larger font</fontsize>.") |