NativeExcel for .Net Developer's Reference

IColorFormat.RGB Property

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

[Visual Basic]
PropertyRGBAsColor
[C#]
ColorRGB{get;set;}
[C++]
__propertyColorget_RGB();
__propertyvoidset_RGB(Color);
[JScript]
functiongetRGB():Color
functionsetRGB(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); 
[VisualBasic]
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