Shared ck As New CheckBox()
Public Class myEditor
Implements FarPoint.Win.Spread.CellType.IEditor
Public Event EditingStopped(ByVal sender As Object, ByVal e As EventArgs) Implements FarPoint.Win.Spread.CellType.IEditor.EditingStopped
Public Event EditingCancelled(ByVal sender As Object, ByVal e As EventArgs) Implements FarPoint.Win.Spread.CellType.IEditor.EditingCanceled
Public Function StopEditing() As Boolean Implements FarPoint.Win.Spread.CellType.IEditor.StopEditing
RaiseEvent EditingStopped(ck, EventArgs.Empty)
MyBase.FireEditingStopped()
Return True
End Function
Public Sub CancelEditing() Implements FarPoint.Win.Spread.CellType.IEditor.CancelEditing
RaiseEvent EditingCancelled(ck, EventArgs.Empty)
MyBase.FireEditingCanceled()
End Sub
Public Function IsReservedKey(ByVal e As KeyEventArgs) As Boolean Implements FarPoint.Win.Spread.CellType.IEditor.IsReservedKey
Return False
End Function
Public Function IsValid(ByVal value As Object) As Boolean Implements FarPoint.Win.Spread.CellType.IEditor.IsValid
Return True
End Function
Public Function GetReservedCursor(ByVal o As Object) As Cursor Implements FarPoint.Win.Spread.CellType.IEditor.GetReservedCursor
Return Nothing
End Function
Public Function GetEditorControl(ByVal appr As FarPoint.Win.Spread.Appearance, ByVal zoom As Single) As Control Implements
FarPoint.Win.Spread.CellType.IEditor.GetEditorControl
Return ck
End Function
Public Function GetEditorValue() As Object Implements FarPoint.Win.Spread.CellType.IEditor.GetEditorValue
Return ck.CheckState
End Function
Public Function GetPreferredSize(ByVal editor As System.Windows.Forms.Control) As Size Implements FarPoint.Win.Spread.CellType.IEditor.GetPreferredSize
Return editor.Size
End Function
Public Sub SetEditorValue(ByVal value As Object) Implements FarPoint.Win.Spread.CellType.IEditor.SetEditorValue
ck.CheckState = CheckState.Checked
End Sub
Public Function IsReservedLocation(ByVal g As Graphics, ByVal x As Integer, ByVal y As Integer, ByVal r As Rectangle,
ByVal appr As FarPoint.Win.Spread.Appearance, ByVal value As Object, ByVal zoom As Single) As Object Implements FarPoint.Win.Spread.CellType.IEditor.IsReservedLocation
Return Nothing
End Function
Public Sub StartEditing(ByVal e As EventArgs, ByVal selectAll As Boolean) Implements FarPoint.Win.Spread.CellType.IEditor.StartEditing
selectAll = True
End Sub
Public Sub ShowSubEditor() Implements FarPoint.Win.Spread.CellType.IEditor.ShowSubEditor
Me.ShowSubEditor()
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).Editor = New myEditor()
End Sub