Spread Windows Forms 17
In This Topic
    Adding a Comment to a Cell
    In This Topic

    Gradient Fill Effect

    You can also add gradient effects to emphasize the comments blocks by applying fill-color and patterns.

     comment-gradient

    Using Code

    To add the gradient effects, use the Fill property of the IShapeBase interface.

    C#
    Copy Code
    fpSpread1.Features.EnhancedShapeEngine = true;
    IWorksheet TestActiveSheet = fpSpread1.AsWorkbook().ActiveSheet;
    IShape shape;
    shape = TestActiveSheet.Cells["A1"].AddComment("InsetPen = false").Shape;
    TestActiveSheet.Cells["A1"].Comment.Visible = true;
    shape.Fill.OneColorGradient(GrapeCity.Spreadsheet.Drawing.GradientStyle.FromCenter, 1, 1);
    shape.Fill.GradientStops.Delete(0);
    shape.Fill.GradientStops.Delete(0);
    shape.Fill.GradientStops.Delete(0);
    shape.Fill.GradientStops.Insert(0xffff00, 0);
    shape.Fill.GradientStops.Insert(0xffffff, 0.5);
    shape.Fill.GradientStops.Insert(0x00ffff, 1);
    shape.Fill.GradientStops[0].Color.SchemeColor = 23;
    shape.Fill.PathShadeType = GrapeCity.Drawing.PathShadeType.Shape;
    IShape aa = fpSpread1.AsWorkbook().ActiveSheet.Cells["A1"].Comment.Shape;
    
    VB
    Copy Code
    FpSpread1.Features.EnhancedShapeEngine = True
    Dim shape As IShape
    Dim TestActiveSheet As IWorksheet = FpSpread1.AsWorkbook().ActiveSheet
    shape = TestActiveSheet.Cells("A1").AddComment("InsetPen = false").Shape
    TestActiveSheet.Cells("A1").Comment.Visible = True
    shape.Fill.OneColorGradient(GrapeCity.Spreadsheet.Drawing.GradientStyle.FromCenter, 1, 1)
    shape.Fill.GradientStops.Delete(0)
    shape.Fill.GradientStops.Delete(0)
    shape.Fill.GradientStops.Delete(0)
    shape.Fill.GradientStops.Insert(&Hffff00, 0)
    shape.Fill.GradientStops.Insert(&HfffffF, 0.5)
    shape.Fill.GradientStops.Insert(&H00fffF, 1)
    shape.Fill.GradientStops(0).Color.SchemeColor = 23
    shape.Fill.PathShadeType = GrapeCity.Drawing.PathShadeType.Shape
    Dim aa As IShape = FpSpread1.AsWorkbook().ActiveSheet.Cells("A1").Comment.Shape
    

    Using Runtime UI

     You can add or manipulate effects at run time via the Fill Effects dialog. The Fill Effects dialog provides options like colors, variants, shading styles, patterns, and a sample preview to view the used gradient effect.

    To add an effect to a comment block, select the comment on the sheet at runtime and use the keyboard shortcut key combination "Ctrl+1". This will invoke the Format Comment dialog box. Navigate to Colors and Lines tab and select the Fill Effects option from the Color picker dropdown.  

    For the keyboard shortcut to work, set the ExcelCompatibleKeyboardShortcuts property to true.
    comment-gradient-runtime

    Using Spread Designer

    To view comments and add gradient effects to the block in the Spread Designer, follow below mentioned steps:

    1. Set the EnhancedShapeEngine and ExcelCompatibleKeyboardShortcuts to true in the properties pane. 
    2. Load the sheet that includes comments. 
    3. Select the comment on which you want to add or modify the gradient effect. 
    4. Right click the comment to view the context menu and select the Format Comment option. 
      comment-gradient-designer
    5. Navigate to Colors and Lines tab of the Format Comment dialog.
      comment-gradient-designer-dialog
    6. Select the Fill Effects button to open the Fill Effects dialog.