Replied 8 September 2017, 1:28 pm EST
Thanks BobM! For the benefit of others, here is what I came up with:
A. Save the editor as a class level variable with events
' Editor for the NumberCellType is a GeneralEditor.
Private WithEvents m_Editor As FarPoint.Win.Spread.CellType.GeneralEditor
Public Overrides Function GetEditorControl(ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal zoomFactor As Single) As System.Windows.Forms.Control
m_Editor = DirectCast(MyBase.GetEditorControl(appearance, zoomFactor), GeneralEditor)
Return m_Editor
End Function 'GetEditorControl
B. Place code in editor KeyDown event to handle the Delete key
Private Sub m_Editor_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles m_Editor.KeyDown
Try
If e.KeyCode = Keys.Escape Then
m_EscapeKeyPressed = True
ElseIf e.KeyCode = Keys.Delete Then
With m_Editor
Dim prefix As String = String.Empty
If .SelectionStart > 0 Then
prefix = .Text.Substring(0, .SelectionStart)
End If
Dim suffix As String = .Text.Substring(.SelectionStart)
If .SelectionStart = 0 Then suffix = suffix.Substring(1)
.Text = prefix & suffix
End With
End If
Catch ex As Exception
Throw
End Try
End Sub