FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > CornerRenderer Class : PaintCorner Method |
'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)
public virtual void PaintCorner( Graphics g, Rectangle r, Color backColor, Color foreColor, Font f, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, string s, TextOrientation textOrientation, bool wordWrap, HotkeyPrefix hotkeyPrefix, StringTrimming stringTrim, VisualStyles visualStyles, bool mouseOver, bool rightToLeft, float zoomFactor )
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
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10