我的spread中使用了MultiColumnComboBoxCell,想要在MultiColumnComboBoxCell中捕捉到esc按下的事件,然后进行其他处理,相同的代码在textboxcell中好用,在MultiColumnComboBoxCell中就不行了,拜托帮忙看看是什么原因造成的。
'========================================================
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.sprData.EditModePermanent = True
Dim im As New FarPoint.Win.Spread.InputMap
im = Me.sprData.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused)
im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
end Sub
Private Sub sprData_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles sprData.KeyDown
Try
Select Case e.KeyCode
Case Windows.Forms.Keys.Escape
Me.MsubESCKeyEvent()
Case Windows.Forms.Keys.F1
Me.MsubF1KeyEvent()
End Select
Catch ex As Exception
throw ex
End Try
End Sub
Private Sub sprData_EditModeOn(ByVal sender As Object, ByVal e As System.EventArgs) Handles sprData.EditModeOn
Try
Dim KeyDownHandler As Windows.Forms.KeyEventHandler = AddressOf Me.sprData_KeyDown
'AddHandler Me.sprData.EditingControl.KeyDown, KeyDownHandler
Catch ex As Exception
throw ex
End Try
End Sub
Private Sub sprData_EditModeOff(ByVal sender As Object, ByVal e As System.EventArgs) Handles sprData.EditModeOff
Try
Dim KeyDownHandler As Windows.Forms.KeyEventHandler = AddressOf Me.sprData_KeyDown
RemoveHandler Me.sprData.EditingControl.KeyDown, KeyDownHandler
Catch ex As Exception
throw ex
End Try
End Sub
'================================================== |
|