Back to DOM
UnderlineClass
Definition
- Namespace
- DOM.Styles
- Assembly
- DOM.dll
Describes underline styling for text runs.
Remarks
aggregates underline appearance settings such as the underline color, whether the underline fill should follow the text color, and the underline line style. Properties are nullable so consumers can distinguish between "unspecified" and explicit values and apply style inheritance or document defaults. Underline Underline settings are assigned via . Underline
Examples
csharp
1// 1. Simple single underline in the text color
2var u = new Underline
3{
4 LineValue = UnderlineValues.Single,
5 FillColorFollowText = true
6};
7
csharp
1// 2. Dotted gray underline
2var u = new Underline
3{
4 LineValue = UnderlineValues.Dotted,
5 Color = Color.Gray,
6 FillColorFollowText = false
7};
8
csharp
1// 3. Double underline for emphasis
2var u = new Underline
3{
4 LineValue = UnderlineValues.Double,
5 Color = Color.DarkBlue
6};
7
csharp
1// 4. Wave underline for a hyperlink
2var u = new Underline
3{
4 LineValue = UnderlineValues.Wave,
5 Color = Color.Blue
6};
7
csharp
1// 5. Attach to a font
2var font = new Font
3{
4 Latin = new FontPart { FontName = "Calibri", Size = 11.0 },
5 Underline = new Underline { LineValue = UnderlineValues.Single, FillColorFollowText = true }
6};
7
Properties
Color
Gets or sets the color used for the underline stroke.
FillColorFollowText
Gets or sets a value indicating whether the underline's fill should follow the text color.
LineValueUnderlineValues
Gets or sets the underline line style (single, double, dotted, dashed, etc.).