NativeExcel for .Net Developer's Reference

IBorder Interface

Represents the border of an object. The IBorder interface is a member of the IBorders collection.

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

[Visual Basic]
PublicInterfaceIBorder
[C#]
publicinterfaceIBorder
[C++]
public__gc__interfaceIBorder
[JScript]
publicinterfaceIBorder

Example

The following example adds a double red border to cell A1 on worksheet one.

[C#]
IBorder border = book.Worksheets[1].Range["A1"].Borders[XlBordersIndex.xlAround];  
border.LineStyle = XlLineStyle.xlDouble;  
border.Color = System.Drawing.Color.Red;  
[VisualBasic]
Dim border As IBorder = book.Worksheets(1).Range("A1").Borders(XlBordersIndex.xlAround)
border.LineStyle = XlLineStyle.xlDouble
border.Color = System.Drawing.Color.Red
[C++]
IRange* range = book->Worksheets->Item[1]->Range->Item[S"A1"];
IBorder* border = range->Borders->Item[XlBordersIndex::xlAround];  
border->LineStyle = XlLineStyle::xlDouble;  
border->Color = System::Drawing::Color::Red;  

Requirements

Namespace: NativeExcel

Assembly: NativeExcel (in NativeExcel.dll)

See Also

IBorder Members | NativeExcel Namespace | IRange.Borders Property | IBorders Interface