NativeExcel2 for .Net Developer's Reference

ILineFormat Interface

Represents line formatting. For a shape with a border, this interface contains formatting information for the shape's border.

For a list of all members of this type, see ILineFormat Members.

[Visual Basic]
PublicInterfaceILineFormat
[C#]
publicinterfaceILineFormat
[C++]
public__gc__interfaceILineFormat
[JScript]
publicinterfaceILineFormat

Remarks

Use the Line property to return an ILineFormat interface.

Example

The following example adds a green, dashed border to first shape on sheet one.

[C#]
IShapes shapes = book.Worksheets[1].Shapes;
if (shapes.Count > 0) {
   ILineFormat line = shapes[1].Line;
   line.Style     = MsoLineStyle.msoLineSingle;
   line.DashStyle = MsoLineDashStyle.msoLineDash;
   line.Weight    = 2;
   line.Visible   = true;
   line.ForeColor.RGB = System.Drawing.Color.FromArgb(0x00A000);
}
[VisualBasic]
Dim shapes As IShapes = book.Worksheets(1).Shapes
If shapes.Count > 0 Then
   Dim line As ILineFormat = shapes(1).Line
   line.Style     = MsoLineStyle.msoLineSingle
   line.DashStyle = MsoLineDashStyle.msoLineDash
   line.Weight    = 2
   line.Visible   = True
   line.ForeColor.RGB = System.Drawing.Color.FromArgb(&H00A000)
End If
[C++]
IShapes* shapes = book->Worksheets->Item[1]->Shapes;
if (shapes->Count > 0) {
   ILineFormat* line = shapes->Item[1]->Line;
   line->Style     = MsoLineStyle::msoLineSingle;
   line->DashStyle = MsoLineDashStyle::msoLineDash;
   line->Weight    = 2;
   line->Visible   = true;
   line->ForeColor.RGB = System::Drawing::Color::FromArgb(0x00A000);
}

Requirements

Namespace: NativeExcel

Assembly: NativeExcel (in NativeExcel.dll)

See Also

ILineFormat Members | NativeExcel Namespace | IShape.Line Property | IShape interface