NativeExcel for .Net Developer's Reference

IColorFormat Interface

Represents the color of a one-color object, the foreground or background color of an object with a gradient or patterned fill. You can set colors to an explicit System.Drawing.Color value (by using the RGB property) or to a color in the color scheme (by using the SchemeColor property).

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

[Visual Basic]


The following example adds a comment to cell B2 and then sets the foreground color for the comment's fill.

IRange range = book.Worksheets[1].Range["B2"];
IComment comment = range.AddComment("Comment text");
comment.Shape.Fill.ForeColor.RGB = System.Drawing.Color.FromArgb(180,180,255); 
Dim range As IRange = book.Worksheets(1).Range("B2")
Dim comment As IComment = range.AddComment("Comment text")
comment.Shape.Fill.ForeColor.RGB = System.Drawing.Color.FromArgb(180,180,255)
IRange* range = book->Worksheets->Item[1]->Range->Item[S"B2"];
IComment* comment = range->AddComment(S"Comment text");
comment->Shape->Fill->ForeColor->RGB = System::Drawing::Color::FromArgb(180,180,255); 


Namespace: NativeExcel

Assembly: NativeExcel (in NativeExcel.dll)

See Also

IColorFormat Members | NativeExcel Namespace | ILineFormat.ForeColor Property | ILineFormat.BackColor Property | IFillFormat.ForeColor Property | IFillFormat.BackColor Property | IPalette interface