NativeExcel for .Net Developer's Reference

IColorFormat.SchemeColor Property

Gets or sets the color as an index in the current palette.

[Visual Basic]
PropertySchemeColorAsInteger
[C#]
intSchemeColor{get;set;}
[C++]
__propertyintget_SchemeColor();
__propertyvoidset_SchemeColor(int);
[JScript]
functiongetSchemeColor():int
functionsetSchemeColor(int);

Property Value

Integer. An index in the current palette.

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.SchemeColor = 31;
comment.Text = String.Format("SchemeColor #31 is equal RGB {0:x6}", comment.Shape.Fill.ForeColor.RGB.ToArgb()); 
[VisualBasic]
Dim range As IRange = book.Worksheets(1).Range("B2")
Dim comment As IComment = range.AddComment("Comment text")
comment.Shape.Fill.ForeColor.SchemeColor = 31
comment.Text = String.Format("SchemeColor #31 is equal RGB {0:x6}", comment.Shape.Fill.ForeColor.RGB.ToArgb())
[C++]
IRange* range = book->Worksheets->Item[1]->Range->Item[S"B2"];
IComment* comment = range->AddComment(S"Comment text");
comment->Shape->Fill->ForeColor->SchemeColor = 31;
comment->Text = String.Format(S"SchemeColor #31 is equal RGB {0:x6}", comment->Shape->Fill->ForeColor->RGB->ToArgb()); 

See Also

IColorFormat Interface | NativeExcel Namespace | RGB Property | IPalette interface