问题在于Spread处于编辑状态下,Tab键按下后,keyDown事件无法触发。
例:FpSpread1_KeyDown无法触发。
Private Sub FpSpread1_KeyDown(sender As Object, e As KeyEventArgs) Handles FpSpread1.KeyDown
MsgBox("FpSpread1_KeyDown")
End Sub
Private Sub FpSpread1_EditModeOn(sender As Object, e As EventArgs) Handles FpSpread1.EditModeOn
RemoveHandler FpSpread1.EditingControl.KeyDown, AddressOf FpSpread1_KeyDown
End Sub
Private Sub FpSpread1_EditModeOff(sender As Object, e As EventArgs) Handles FpSpread1.EditModeOff
AddHandler FpSpread1.EditingControl.KeyDown, AddressOf FpSpread1_KeyDown
End Sub
Private Sub Form11_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim FpSpread1_InputMapWhenFocusedNormal As FarPoint.Win.Spread.InputMap
Dim FpSpread1_InputMapWhenAncestorOfFocusedNormal As FarPoint.Win.Spread.InputMap
FpSpread1_InputMapWhenFocusedNormal = New FarPoint.Win.Spread.InputMap()
FpSpread1_InputMapWhenAncestorOfFocusedNormal = New FarPoint.Win.Spread.InputMap()
FpSpread1_InputMapWhenFocusedNormal.Put(New FarPoint.Win.Spread.Keystroke(System.Windows.Forms.Keys.Tab, System.Windows.Forms.Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextItem)
Me.FpSpread1.SetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused, FarPoint.Win.Spread.OperationMode.Normal, FpSpread1_InputMapWhenFocusedNormal)
FpSpread1_InputMapWhenAncestorOfFocusedNormal.Put(New FarPoint.Win.Spread.Keystroke(System.Windows.Forms.Keys.Tab, System.Windows.Forms.Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextColumn)
Me.FpSpread1.SetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused, FarPoint.Win.Spread.OperationMode.Normal, FpSpread1_InputMapWhenAncestorOfFocusedNormal)
End Sub
|