Spread Windows Forms 11.0 Product Documentation
PaintCorner Method (CornerRenderer)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > CornerRenderer Class : PaintCorner Method
Graphics device interface for painting the corner cell
Location and size of a rectangular region for painting the corner cell
Background color of the corner cell
Foreground color of the corner cell
Font
Horizontal alignment of corner cell content
Vertical alignment of the corner cell content
String to paint
Orientation of the text
Whether to wrap words to multiple lines
Whether to show hotkey effects
String trimming mode
Visual styles
Whether the mouse is over the corner cell
Whether to display right to left
Numeric value for scaling the display of the corner cell
Paints the corner cell.
Syntax
'Declaration
 
Public Overridable Sub PaintCorner( _
   ByVal g As Graphics, _
   ByVal r As Rectangle, _
   ByVal backColor As Color, _
   ByVal foreColor As Color, _
   ByVal f As Font, _
   ByVal horizontalAlignment As HorizontalAlignment, _
   ByVal verticalAlignment As VerticalAlignment, _
   ByVal s As String, _
   ByVal textOrientation As TextOrientation, _
   ByVal wordWrap As Boolean, _
   ByVal hotkeyPrefix As HotkeyPrefix, _
   ByVal stringTrim As StringTrimming, _
   ByVal visualStyles As VisualStyles, _
   ByVal mouseOver As Boolean, _
   ByVal rightToLeft As Boolean, _
   ByVal zoomFactor As Single _
) 
'Usage
 
Dim instance As CornerRenderer
Dim g As Graphics
Dim r As Rectangle
Dim backColor As Color
Dim foreColor As Color
Dim f As Font
Dim horizontalAlignment As HorizontalAlignment
Dim verticalAlignment As VerticalAlignment
Dim s As String
Dim textOrientation As TextOrientation
Dim wordWrap As Boolean
Dim hotkeyPrefix As HotkeyPrefix
Dim stringTrim As StringTrimming
Dim visualStyles As VisualStyles
Dim mouseOver As Boolean
Dim rightToLeft As Boolean
Dim zoomFactor As Single
 
instance.PaintCorner(g, r, backColor, foreColor, f, horizontalAlignment, verticalAlignment, s, textOrientation, wordWrap, hotkeyPrefix, stringTrim, visualStyles, mouseOver, rightToLeft, zoomFactor)

Parameters

g
Graphics device interface for painting the corner cell
r
Location and size of a rectangular region for painting the corner cell
backColor
Background color of the corner cell
foreColor
Foreground color of the corner cell
f
Font
horizontalAlignment
Horizontal alignment of corner cell content
verticalAlignment
Vertical alignment of the corner cell content
s
String to paint
textOrientation
Orientation of the text
wordWrap
Whether to wrap words to multiple lines
hotkeyPrefix
Whether to show hotkey effects
stringTrim
String trimming mode
visualStyles
Visual styles
mouseOver
Whether the mouse is over the corner cell
rightToLeft
Whether to display right to left
zoomFactor
Numeric value for scaling the display of the corner cell
Example
This example creates a custom corner renderer.
public class MyCornerRenderer : FarPoint.Win.Spread.CellType.CornerRenderer
        {
                              
            public override void PaintCorner(Graphics g, Rectangle r, Color c, Color back, Font f, FarPoint.Win.HorizontalAlignment halign, FarPoint.Win.VerticalAlignment valign, string s, FarPoint.Win.TextOrientation to, bool wordwrap, System.Drawing.Text.HotkeyPrefix hk, StringTrimming st, FarPoint.Win.VisualStyles vs, bool mouseover, bool rtl, float zf)
            {
               // g.FillRectangle(Brushes.Aqua, 0, 0, 30, 30);
                c = Color.Red;
                back = Color.Aqua;
                f = new Font("Arial", 10);
                halign = FarPoint.Win.HorizontalAlignment.Left;
                hk = System.Drawing.Text.HotkeyPrefix.None;
                valign = FarPoint.Win.VerticalAlignment.Center;
                to = FarPoint.Win.TextOrientation.TextHorizontal;
                wordwrap = true;
                s = "s";
                st = StringTrimming.None;
                vs = FarPoint.Win.VisualStyles.Off;
                mouseover = false;
                rtl = false;
                zf = 0.5F;
                base.PaintCorner(g, r, c, back, f, halign, valign, s, to, wordwrap, hk, st, vs, mouseover, rtl, zf);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            fpSpread1.ActiveSheet.SheetCornerStyle.Renderer = new MyCornerRenderer();
}
Public Class MyCornerRenderer
        Inherits FarPoint.Win.Spread.CellType.CornerRenderer

        Public Overrides Sub PaintCorner(g As Graphics, r As Rectangle, c As Color, back As Color, f As Font, halign As FarPoint.Win.HorizontalAlignment,
                               valign As FarPoint.Win.VerticalAlignment, s As String, tor As FarPoint.Win.TextOrientation, wordwrap As Boolean, hk As System.Drawing.Text.HotkeyPrefix, sf As StringTrimming, vs As FarPoint.Win.VisualStyles, mouseover As Boolean, rtl As Boolean, zf As Single)

            c = Color.Red
            back = Color.Aqua
            f = New Font("Arial", 10)
            halign = FarPoint.Win.HorizontalAlignment.Left
            hk = System.Drawing.Text.HotkeyPrefix.None
            valign = FarPoint.Win.VerticalAlignment.Center
            tor = FarPoint.Win.TextOrientation.TextHorizontal
            wordwrap = True
            s = "s"
            sf = StringTrimming.None
            vs = FarPoint.Win.VisualStyles.Off
            mouseover = False
            rtl = False
            zf = 0.5F
            MyBase.PaintCorner(g, r, c, back, f, halign, valign, s, tor, wordwrap, hk, sf, vs, mouseover, rtl, zf)
        End Sub
    End Class

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        fpSpread1.ActiveSheet.SheetCornerStyle.Renderer = New MyCornerRenderer()
    End Sub
See Also

Reference

CornerRenderer Class
CornerRenderer Members