Shared ck As New CheckBox()
Public Class myRenderer
Implements FarPoint.Win.Spread.CellType.IRenderer
Public Function CanBeOverflown() As Boolean Implements FarPoint.Win.Spread.CellType.IRenderer.CanBeOverflown
Return True
End Function
Public Function CanOverflow() As Boolean Implements FarPoint.Win.Spread.CellType.IRenderer.CanOverflow
Return True
End Function
Public Function GetPreferredSize(ByVal g As Graphics, ByVal s As Size, ByVal appr As FarPoint.Win.Spread.Appearance, ByVal
value As Object, ByVal zoom As Single) As Size Implements FarPoint.Win.Spread.CellType.IRenderer.GetPreferredSize
s = New Size(50, 50)
Return s
End Function
Public Sub PaintCell(ByVal g As Graphics, ByVal r As Rectangle, ByVal appr As FarPoint.Win.Spread.Appearance, ByVal Value
As Object, ByVal issel As Boolean, ByVal islocked As Boolean, ByVal zoom As Single) Implements FarPoint.Win.Spread.CellType.IRenderer.PaintCell
Dim s As String
ck.CheckState = CheckState.Checked
s = ck.CheckState.ToString()
Dim f As New Font("MS Sans Serif", 10)
appr.BackColor = Color.Red
appr.ForeColor = Color.Yellow
appr.Font = f
Dim b, b1 As Brush
b = New SolidBrush(appr.BackColor)
b1 = New SolidBrush(appr.ForeColor)
g.FillRectangle(b, r)
g.DrawString(s, appr.Font, b1, r.X, r.Y)
b.Dispose()
b1.Dispose()
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.Cells(0, 0).Renderer = New myRenderer()
End Sub