Spread Windows Forms 6.0 Product Documentation
Text Display in the Sheet Corner
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Customizing the Sheet Appearance > Customizing the Sheet Corner Appearance > Text Display in the Sheet Corner

Glossary Item Box

You can add text to the sheet corner cell of the spreadsheet by setting the SheetCorner properties or overriding the PaintCell method. The figure shows the results of the example code given here.

Sheet corner with text

See the topic General Style of the Sheet Corner to set the text using the SheetCorner properties.

Return to the overview of Customizing the Sheet Corner Appearance

Using Code (to Customize Corner Text)

You can assign text to the sheet corner cell by overriding the painting of the cell and painting it with the specified text.

Example (Custom Text in Corner)

C# Copy Code
class CornerCell : FarPoint.Win.Spread.CellType.GeneralCellType
 
{
 
   public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
 
   {
 
      base.PaintCell(g, r, appearance, "Text", isSelected, isLocked, zoomFactor);
 
   }
 
}
 
   
 
CornerCell sctextcell = new CornerCell();
 
fpSpread1.Sheets[0].SheetCornerStyle.CellType = sctextcell;
 
VB Copy Code
Public Class SheetCorner
 
Inherits FarPoint.Win.Spread.CellType.GeneralCellType
 
   
 
   Public Overrides Sub PaintCell(ByVal g As System.Drawing.Graphics, ByVal r As System.Drawing.Rectangle, ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal value As Object, ByVal isSelected As Boolean, ByVal isLocked As Boolean, ByVal zoomFactor As Single)
 
      MyBase.PaintCell(g, r, appearance, "Text", isSelected, isLocked, zoomFactor)
 
   End Sub
 
End Class
 
   
 
Dim sctextcell As New SheetCorner()
 
FpSpread1.Sheets(0).SheetCornerStyle.CellType = sctextcell
 

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.