NativeExcel for .Net Developer's Reference

IFont.Underline Property

Returns or sets the type of underline applied to the font. Read/write XlUnderlineStyle.

[Visual Basic]
PropertyUnderlineAsXlUnderlineStyle
[C#]
XlUnderlineStyleUnderline{get;set;}
[C++]
__propertyXlUnderlineStyleget_Underline();
__propertyvoidset_Underline(XlUnderlineStyle);
[JScript]
functiongetUnderline():XlUnderlineStyle
functionsetUnderline(XlUnderlineStyle);

Example

This example sets the font in the cell A1 to single underline.

[C#]
book.Worksheets[1].Range["A1"].Font.Underline = XlUnderlineStyle.xlUnderlineStyleSingle;
[VisualBasic]
book.Worksheets(1).Range("A1").Font.Underline = XlUnderlineStyle.xlUnderlineStyleSingle
[C++]
book->Worksheets->Item[1]->Range->Item[S"A1"]->Font->Underline = XlUnderlineStyle::xlUnderlineStyleSingle;

See Also

IFont Interface | NativeExcel Namespace