Search Results for

    Show / Hide Table of Contents

    Class Underline

    Represents the underline formatting applied to text in a Word document.

    Inheritance
    System.Object
    Underline
    Namespace: IronWord.Models
    Assembly: IronWord.dll
    Syntax
    public class Underline : Object

    When a run of text needs an underline, whether a plain single rule or a styled, colored line, Underline describes it. It captures both the line style and its color in one object, so you decide what the underline looks like and let the run's style carry it onto the page.

    An Underline reaches text through TextStyle, which exposes an Underline property. Assign a configured instance there and any run formatted with that style gains the underline. You can build one with the default constructor and set properties individually, or use the constructor that takes the line style, the colors, and the theme values together when you have all the details up front.

    The line style itself is LineValue, a nullable UnderlineValues that selects a single, double, dotted, or wavy rule (leave it unset for no explicit underline). Color sets a direct color for the line, while ThemeColor, ThemeShade, and ThemeTint tie it to the document theme so the underline tracks theme changes the way themed text does. Use a direct Color for a fixed look or the theme properties when the underline should follow the document's palette. Clone returns a copy, which is convenient when several runs share an underline that differs only in color, letting you duplicate the base and adjust one property. Configure the line, assign it to a TextStyle, and the underline renders when the document is saved.

    using IronWord.Models;
    
    var underline = new Underline();
    underline.LineValue = UnderlineValues.Single;
    underline.Color = Color.Black;

    The style text how-to applies underlines and other formatting, the styled text example shows formatting in code, and the add text how-to places the underlined runs in a document.

    Constructors

    Underline()

    Initializes a new instance of the Underline class with default values.

    Declaration
    public Underline()

    Underline(UnderlineValues, Color, Color, Int32, Double)

    Initializes a new instance of the Underline class with the specified parameters.

    Declaration
    public Underline(UnderlineValues val, Color color, Color themeColor, int themeShade, double themeTint)
    Parameters
    Type Name Description
    UnderlineValues val

    The style of the underline.

    Color color

    The color of the underline.

    Color themeColor

    The theme color of the underline.

    System.Int32 themeShade

    The shade of the theme color used for the underline.

    System.Double themeTint

    The tint of the theme color used for the underline.

    Properties

    Color

    Gets or sets the color of the underline.

    Declaration
    public Color Color { get; set; }
    Property Value
    Type Description
    Color

    LineValue

    Gets or sets the style of the underline.

    Declaration
    public Nullable<UnderlineValues> LineValue { get; set; }
    Property Value
    Type Description
    System.Nullable<UnderlineValues>

    ThemeColor

    Gets or sets the theme color of the underline.

    Declaration
    public Color ThemeColor { get; set; }
    Property Value
    Type Description
    Color

    ThemeShade

    Gets or sets the shade of the theme color used for the underline.

    Declaration
    public Nullable<int> ThemeShade { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    ThemeTint

    Gets or sets the tint of the theme color used for the underline.

    Declaration
    public Nullable<double> ThemeTint { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Double>

    Methods

    Clone()

    Creates a copy of this Underline object.

    Declaration
    public Underline Clone()
    Returns
    Type Description
    Underline

    A new Underline object with the same property values.

    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet
    %s requires a valid license key for further deployment. Get Trial Below.
    ironsuite
    Blue key in circleGet Started for Free
    30 days full access • No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet Started for Free
    The trial form was submitted successfully.
    Grey check in circleTrial key delivered
    Your key has been issued and sent to your email.
    Calendar in circleBook Free Live Demo
    No cards • no pitches • no commitments Pick a time for a quick, personalized demo
    Get the most out of your 30-day trial with:

    Live product and key features walk-through

    Project-specific recommendations

    All your questions answered

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation

    Want to deploy Iron Suite
    to a live project for FREE?

    What’s included?

    • Test in production without watermarks
    • 30 days fully functional product
    • 24/5 technical support during trial
    ironpdf Logo
    ironword Logo
    ironxl Logo
    ironppt Logo
    ironocr Logo
    ironbarcode Logo
    ironqr Logo
    ironprint Logo
    ironzip Logo
    ironwebscraper Logo
    Iron Software sales team
    Online 24/5
    Have Enterprise licensing requirements?
    Request Iron Suite Enterprise trial
    Key in blue circle

    Get your free 30-day Trial Key instantly

    Your trial license will be sent to your email address

    No limitations. 100% unlocked. No credit card.

    bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Or
    Key in blue circle

    Complete Your Trial Key Signup

    Tell us a little more about yourself.

    Key in blue circleNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Key in blue circle

    Your license key has been delivered to your inbox

    Can't find it? Check your spam folder.

    What’s next?
    Install with NuGet
    Add IronWord to your project
    Quickstart Guide
    Helpful resources to get started

    Need help getting started?

    Book a Free Live Demo

    See IronWord in action and get your licensing questions answered, or

    Key in blue circle

    Your demo request is in.

    You'll receive an invite via email shortly.

    What’s next?
    Explore Documentation
    Review Licensing Options
    badge_greencheck_in_yellowcircle
    Thank you
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronWord
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com