Back to Devexpress

RichTextRunFont.UnderlineType Property

officefileapi-devexpress-dot-spreadsheet-dot-richtextrunfont-51ba60ad.md

latest5.7 KB
Original Source

RichTextRunFont.UnderlineType Property

Gets or sets the underline type applied to the current text run.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public UnderlineType UnderlineType { get; set; }
vb
Public Property UnderlineType As UnderlineType

Property Value

TypeDescription
UnderlineType

An UnderlineType enumeration value.

|

Available values:

NameDescription
None

Indicates that the text is not underlined.

| | Single |

Specifies a single underline.

| | Double |

Specifies a double underline.

| | SingleAccounting |

Specifies a single accounting underline (an underline that fills the entire cell width).

| | DoubleAccounting |

Specifies a double accounting underline (an underline that fills the entire cell width).

|

Remarks

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 UnderlineType 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#L56

csharp
case DevExpress.XtraRichEdit.API.Native.UnderlineType.Single:
    runFont.UnderlineType = DevExpress.Spreadsheet.UnderlineType.Single;
    break;

blazor-grid-export-images-and-rich-text-using-office-file-api/CS/ExportImagesAndRichText/Models/CustomDocumentVisitor.cs#L51

csharp
case DevExpress.XtraRichEdit.API.Native.UnderlineType.Single:
    runFont.UnderlineType = DevExpress.Spreadsheet.UnderlineType.Single;
    break;

winforms-spreadsheet-how-to-edit-rich-text/VB/SpreadsheetRichText/RichTextEditForm.vb#L35

vb
End Select
Select Case run.Font.UnderlineType
    Case DevExpress.Spreadsheet.UnderlineType.Single

Implements

UnderlineType

See Also

AddTextRun(String, RichTextRunFont)

Font

How to: Apply Rich Formatting to Cell Text

RichTextRunFont Class

RichTextRunFont Members

DevExpress.Spreadsheet Namespace