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] Public Interface IColorFormat [C#] public interface IColorFormat [C++] public __gc __interface IColorFormat [JScript] public interface IColorFormat
The following example adds a comment to cell B2 and then sets the foreground color for the comment's fill.
[C#]
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);
[Visual Basic]
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)
[C++]
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)
IColorFormat Members | NativeExcel Namespace | ILineFormat.ForeColor Property | ILineFormat.BackColor Property | IFillFormat.ForeColor Property | IFillFormat.BackColor Property | IPalette interface