Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 860 Bytes

Comments-Style-Colors-and-Lines.md

File metadata and controls

25 lines (20 loc) · 860 Bytes

ColorsAndLines.jpg

var wb = new XLWorkbook();
var ws = wb.Worksheets.Add("Colors and Lines");

ws.Cell("A2").Comment
  .AddText("Now ")
  .AddText("THIS").SetBold().SetFontColor(XLColor.Red)
  .AddText(" is colorful!");

ws.Cell("A2").Comment.Style
  .ColorsAndLines.SetFillColor(XLColor.RichCarmine)
  .ColorsAndLines.SetFillTransparency(0.25) // 25% opaque
  .ColorsAndLines.SetLineColor(XLColor.Blue)
  .ColorsAndLines.SetLineTransparency(0.75) // 75% opaque
  .ColorsAndLines.SetLineDash(XLDashStyle.LongDash)
  .ColorsAndLines.SetLineStyle(XLLineStyle.ThickBetweenThin)
  .ColorsAndLines.SetLineWeight(7.5);

// Set all comments to visible
ws.CellsUsed(true, c => c.HasComment).ForEach(c => c.Comment.SetVisible());

wb.SaveAs("CommentsColorsAndLines.xlsx");