officefileapi-devexpress-dot-spreadsheet-dot-richtextrunfont-0c9ac798.md
Gets or sets whether the current text run is formatted as subscript, superscript, or neither.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
public ScriptType Script { get; set; }
Public Property Script As ScriptType
| Type | Description |
|---|---|
| ScriptType |
A ScriptType enumerator member indicating whether a text region is subscript or superscript.
|
Available values:
| Name | Description |
|---|---|
| None |
Specifies that the text is not formatted as subscript or as superscript.
| | Superscript |
Formats text as superscript.
| | Subscript |
Formats text as subscript.
|
The RichTextRunFont object’s properties allow you to specify font settings for individual regions of the cell text (so-called text runs defined by the RichTextRun objects).
You can do one of the following to apply rich formatting to a portion of the cell text:
Call the CellRange.SetRichText method to assign the rich formatted text to a cell.
To view font settings applied to an existing run, use the run’s RichTextRun.Font property.
Refer to the How to: Apply Rich Formatting to Cell Text document for examples on how to apply different fonts to specific regions of the cell text.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Script property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-spreadsheet-how-to-edit-rich-text/CS/SpreadsheetRichText/CustomDocumentVisitor.cs#L43
case DevExpress.Office.CharacterFormattingScript.Subscript:
runFont.Script = ScriptType.Subscript;
break;
case DevExpress.Office.CharacterFormattingScript.Subscript:
runFont.Script = ScriptType.Subscript;
break;
winforms-spreadsheet-how-to-edit-rich-text/VB/SpreadsheetRichText/RichTextEditForm.vb#L26
cp.Strikeout = If(run.Font.Strikethrough, StrikeoutType.Single, StrikeoutType.None)
Select Case run.Font.Script
Case ScriptType.Subscript
See Also
AddTextRun(String, RichTextRunFont)