NativeExcel2 for .Net Developer's Reference

ILineFormat.ForeColor Property

Gets or sets an IColorFormat interface that represents the foreground color for the line.

[Visual Basic]
PropertyForeColorAsIColorFormat
[C#]
IColorFormatForeColor{get;set;}
[C++]
__propertyIColorFormat*get_ForeColor();
__propertyvoidset_ForeColor(IColorFormat*);
[JScript]
functiongetForeColor():IColorFormat
functionsetForeColor(IColorFormat);

Property Value

IColorFormat interface.

Example

This example changes the color of the comment border on cell B2 to red

[C#]
IComment comment = book.Worksheets[1].Range["B2"].Comment;
if (comment != null) {
   comment.Shape.Line.ForeColor.RGB = Color.FromArgb(0x0000FF);
}
[VisualBasic]
Dim comment As IComment = book.Worksheets(1).Range("B2").Comment
If Not comment Is Nothing Then
   comment.Shape.Line.ForeColor.RGB = Color.FromArgb(&H0000FF)
End If
[C++]
IComment* comment = book->Worksheets->Item[1]->Range->Item[S"B2"]->Comment;
if (comment != null) {
   comment->Shape->Line->ForeColor->RGB = Color::FromArgb(0x0000FF);
}

See Also

ILineFormat Interface | NativeExcel Namespace | IColorFormat interface | BackColor property