NativeExcel for .Net Developer's Reference

ILineFormat.DashStyle Property

Gets or sets a value that represents the dash style for the specified line.

[Visual Basic]
PropertyDashStyleAsMsoLineDashStyle
[C#]
MsoLineDashStyleDashStyle{get;set;}
[C++]
__propertyMsoLineDashStyleget_DashStyle();
__propertyvoidset_DashStyle(MsoLineDashStyle);
[JScript]
functiongetDashStyle():MsoLineDashStyle
functionsetDashStyle(MsoLineDashStyle);

Property Value

One of the MsoLineDashStyle values.

Example

This example creates new comment on cell B2 with red dashed border

[C#]
IComment comment = book.Worksheets[1].Range["B2"].AddComment("Comment text");
ILineFormat line = comment.Shape.Line;
line.Style     = MsoLineStyle.msoLineSingle;
line.DashStyle = MsoLineDashStyle.msoLineDash;
line.Weight    = 0.25;
line.ForeColor.RGB = Color.FromArgb(0x0000FF);
[VisualBasic]
Dim comment As IComment = book.Worksheets(1).Range("B2").AddComment("Comment text")
Dim line As ILineFormat = comment.Shape.Line
line.Style     = MsoLineStyle.msoLineSingle
line.DashStyle = MsoLineDashStyle.msoLineDash
line.Weight    = 0.25
line.ForeColor.RGB = Color.FromArgb(&H0000FF)
[C++]
IComment* comment = book->Worksheets->Item[1]->Range->Item[S"B2"]->AddComment(S"Comment text");
ILineFormat* line = comment->Shape->Line;
line->Style     = MsoLineStyle::msoLineSingle;
line->DashStyle = MsoLineDashStyle::msoLineDash;
line->Weight    = 0.25;
line->ForeColor->RGB = Color::FromArgb(0x0000FF);

See Also

ILineFormat Interface | NativeExcel Namespace