MindFusion.Wpf Pack Programmer's Guide
FormattedText Constructor (String)
See Also
 





Initializes a new instance of the FormattedText class from the specified markup text.

Namespace: MindFusion.Spreadsheet.Wpf
Assembly: MindFusion.Spreadsheet.Wpf

 Syntax

C#  Copy Code

public FormattedText (
    string text
)

Visual Basic  Copy Code

Public New ( _
    text As String _
)

 Parameters

text

A markup text specifying the formatted text.

 Remarks

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 &lt;, &gt; and &amp; to display respectively the <, > and & symbols.

 Example

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>.")

 See Also

FormattedText Constructor Overload List
FormattedText Class
MindFusion.Spreadsheet.Wpf Namespace