NativeExcel2 for .Net Developer's Reference

IColorFormat.SchemeColor Property

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

[Visual Basic]

Property Value

Integer. An index in the current palette.


This 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.SchemeColor = 31;
comment.Text = String.Format("SchemeColor #31 is equal RGB {0:x6}", comment.Shape.Fill.ForeColor.RGB.ToArgb()); 
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())
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