NativeExcel2 for .Net Developer's Reference

IShape.Line Property

Gets an ILineFormat interface that contains line formatting properties for the specified shape.

[Visual Basic]
PropertyReadOnlyLineAsILineFormat
[C#]
ILineFormatLine{get;}
[C++]
__propertyILineFormat*get_Line();
[JScript]
functiongetLine():ILineFormat

Property Value

ILineFormat interface.

Example

This example sets the border around the shape.

[C#]
IWorksheet sheet = book.Worksheets[1];
sheet.Cells[1,1].Select();
IShape shape = sheet.Shapes.AddPicture("image.jpg");
shape.Line.Style = MsoLineStyle.msoLineThinThick;
shape.Line.Weight = 4.5;  
shape.Line.Visible = true;
shape.Line.ForeColor.RGB = System.Drawing.Color.FromArgb(0x0000FF);
shape.Line.BackColor.RGB = System.Drawing.Color.FromArgb(0x0000FF);
[VisualBasic]
Dim sheet As IWorksheet = book.Worksheets(1)
sheet.Cells(1,1).Select()
Dim shape As IShape = sheet.Shapes.AddPicture("image.jpg")
shape.Line.Style = MsoLineStyle.msoLineThinThick
shape.Line.Weight = 4.5
shape.Line.Visible = True
shape.Line.ForeColor.RGB = System.Drawing.Color.FromArgb(&H0000FF)
shape.Line.BackColor.RGB = System.Drawing.Color.FromArgb(&H0000FF)
[C++]
IWorksheet* sheet = book->Worksheets->Item[1]; 
sheet->Cells->Item[1,1]->Select();
IShape* shape = sheet->Shapes->AddPicture(S"image.jpg");
shape->Line->Style = MsoLineStyle::msoLineThinThick;
shape->Line->Weight = 4.5;  
shape->Line->Visible = true;
shape->Line->ForeColor->RGB = System::Drawing::Color::FromArgb(0x0000FF);
shape->Line->BackColor->RGB = System::Drawing::Color::FromArgb(0x0000FF);

See Also

IShape Interface | NativeExcel Namespace