NativeExcel for .Net Developer's Reference

IColorFormat.RGB Property

Gets or sets the color as a System.Drawing.Color value.

[Visual Basic]
Property RGB As Color
[C#]
Color RGB { get; set; }
[C++]
__property Color get_RGB();
__property void set_RGB(Color );
[JScript]
function get RGB() : Color
function set RGB(Color);

Property Value

System.Drawing.Color.

Example

This 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); 

See Also

IColorFormat Interface | NativeExcel Namespace | SchemeColor Property